-3
int main()
{
    int i=2;
    printf("%d, %d\n", ++i, ++i);
    return 0;
}

can some one explain me. when it compile on turbo c its output is 4,3 and use GCC then it is 4,4;

why this output changes with respect to the compiler

Prashant Gurav
  • 505
  • 7
  • 17

1 Answers1

4

This is undefined behavior, the compiler can do whatever they want.

Yu Hao
  • 119,891
  • 44
  • 235
  • 294