Dalisyron's blog

By Dalisyron, 8 years ago, In English

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? ...

  • Vote: I like it
  • +1
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +30 Vote: I do not like it