I'm new to C++ and study the increment and decrement operators. So I tried this example:
int x = 4;
cout << ++x << " " << x++ << " " << x++ << endl << endl;
cout << x << endl;
It returns this weird output on C++ .NET and QtCreator and 5 online C++ compilers:
7 5 4
7
The weird thing is that I expect something like this:
5 5 6
7
Can you explain what happens?