pre and post increment operations on a variable give different output on TC and gcc [duplicate]
问题 This question already has answers here : Why are these constructs using pre and post-increment undefined behavior? (14 answers) Closed last year . Here is my simple code ... #include<stdio.h> int main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); return 0; } On gcc,it gives output as '4 5 5 5 5' but on TC,it gives output as '4 5 5 4 5' what I know that in printf statement,evaluation will be from left to right if it is a single expression but in normal statement,it will be from