The output for this piece of code is not what I expected :
#include <iostream>
using namespace std;
int main() {
int n = 10;
cout << n << " " << n++;
}
OUTPUT : 11 10
Is it because of the way iostream overloads bitwise shift operator or something else? ...
This is undefined behaviour: https://en.wikipedia.org/wiki/Sequence_point