+ 3
Can anyone explain how the value of p is 9
3 ответов
+ 7
Keep in mind that all #define do is text replacement at preprocessing stage.
So at compile time
r+=FNC(++p,q++)
Will be converted to
r+= (++p>q++)?(++p*q++):(++p-q++)
And now I think it should be pretty clear why value of *p* got incremented twice.
+ 3
I think it is because firstly you pass that ++p into FNC, so it was incremented to 8, then "++p" got moved into the FNC body, and incremented to 9
+ 2
Arsenic is right . The macro you declared above will just copy paste replacing the parameters x, y with ++p and q++.