Please help me explain this .
I' m using MS Visual C++6.0 . First i take the initialization :int i=5;
>if i use printf("%d %d %d",i++,i++,i++ ) ;the output is 5 5 5
>if i use cout<<i++<<i++< <i++; the output is 7 6 5 !
It's so confusing ! Due to the residual -value law of the post increment operator i think the output must be 5 6 7 ! Why 7 6 5 - a reverse order ?
And more , printf and cout are different , but I wonder why ?
I' m using MS Visual C++6.0 . First i take the initialization :int i=5;
>if i use printf("%d %d %d",i++,i++,i++ ) ;the output is 5 5 5
>if i use cout<<i++<<i++< <i++; the output is 7 6 5 !
It's so confusing ! Due to the residual -value law of the post increment operator i think the output must be 5 6 7 ! Why 7 6 5 - a reverse order ?
And more , printf and cout are different , but I wonder why ?
Comment