0
How does this code output this result???(answered, thank you😋)
How does my code output 10 instead of 30? https://code.sololearn.com/cPYJKMr07r8o/?ref=app
6 Antworten
+ 5
More to the point, Rishi, it sees the result of the expression would be (int). That is what really matters. Since it can be determined at compile time, the expression is discarded.
+ 3
Rishi the result of the sizeof is determined at compile time. The compiler only determines the type of the sizeof argument and it hard codes the size of the operand. It does not evaluate the operand at run time. So x remains at its initialized value.
+ 2
Brian oh yeah I got it, thank you. Have a nice day :)
0
Brian so you're saying that, it only sees "x" and not "x=x+20"?
0
Fawad Jan thank you for your comment. That was so helpful
- 2
سلام