In this 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 ++; e ++ x; is that x ++ = 10 + 1 and ++ x = 1 + 10?