S
sahteaccount
int i = 1;
cout<< i++ <<" "<< i++ <<" "<< i <<endl;
When compiled under Linux, it gives this output: 2 1 3
When compiled under MS Visual Studio in Debug mode, it gives this
output: 2 1 1
When compiled under MS Visual Studio in Release mode, it gives this
output: 2 1 3
Shouldn't the output be 1 2 3?
Why is this so? What do I do wrong here?
Thanks
cout<< i++ <<" "<< i++ <<" "<< i <<endl;
When compiled under Linux, it gives this output: 2 1 3
When compiled under MS Visual Studio in Debug mode, it gives this
output: 2 1 1
When compiled under MS Visual Studio in Release mode, it gives this
output: 2 1 3
Shouldn't the output be 1 2 3?
Why is this so? What do I do wrong here?
Thanks