EVM6446
code named a.c:
#include <stdio.h>
int main()
{
int x = 36, y = 20;
x = x++ + y++;
y = ++x + ++y;
printf("x value is %d, y value is %d\n",x,y);
return 1;
}
In three environments, I get two results:
1) Env: Fedora 8
# gcc -c -o a.o a.c
# gcc -o a a.o
# ./a
# x value is 58, y value is 80
2) Env: MontaVista Linux in ARM 926 using arm_v5t_le-gcc
in Minicom, I get the result: x value is 57,y value is 79;
3)Env: Windows CCSv3.3 in C64+
I get the same result with ARM926
I think the result which I get in Fedora 8 is correct. Could anyone tell me why I get the other two results?
Thanks.