1
In that code:
#include <stdio.h>
#include <stdlib.h>
int main() {
int x, y = 10;
//incrementa depois atribui
y = ++x;
printf("x = %d\n", x);
printf("y = %d\n", y);
system("pause");
return 0;
}
Compiled and executed in codeblocks it returns the size of the variable plus the increment; The result should be x = 11; and y = 11; In ideone it returns x and y = 1; The difference between x++; and ++x; is that x++ = 10 + 1 and ++x = 1 + 10?
Good question: has code, has the expected result, has the result obtained.
– pmg
I don’t understand you pmg?
– user24857
user ... many users ask questions that are difficult to answer: your question is efficient.
– pmg