Any reason for the following aberration?
Consider the following C program (named PstFixInc.c)
#include <stdio.h>
int main (int argc, char *argv [])
{
int num = 0;
num = (num++) % 4;
printf ("num: %d\n",num);
return 0;
}
If compiled with gcc 4.8.1
:
gcc -o PstFix.exe PstFixInc.c
and then executed, you get the result:
num: 0
If compiled with Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
cl PstFixInc.c
and then executed, you get the result:
num: 1