0
prefix increment in cpp
Hallo, citizens! Why result of compiling this code: int x = 10, y; y = x + ++x + ++x; cout << x << " "<<y; in vs2010 - 36; in all of online compilers - 34? And what result correct? Thanks.
2 odpowiedzi
0
The result of the calculation is 36 because prefix incrementation is performed before getting the value of x.
0
I guess, in this app result is 34, because it uses a specific compiler. Is there any manual about this?