I Cant really undersdand suffix. I know it first uses identifier and then increases or decreses , as first shows i
and then ++
. But now i think im wrong and still don't understand it.
#include <iostream>
using namespace std;
int main()
{
int i = 0;
cout << i << i++ << i;
cout << "\n\n\nPress Enter to close the window . . . ";
cin.clear();
cin.sync();
cin.get();
return 0;
}
Output:
101
Press Enter to close the window . . .
first i
is changed before increment readed.Why?
I expected
001
Press Enter to close the window . . .
Can someone explain.