Skip to content

Instantly share code, notes, and snippets.

@boustrophedon
Created July 5, 2014 18:07
Show Gist options
  • Save boustrophedon/4822d9f36d294d7e3158 to your computer and use it in GitHub Desktop.
Save boustrophedon/4822d9f36d294d7e3158 to your computer and use it in GitHub Desktop.
the evaluation order of i and ++i is undefined in a single expression. the book said that it's so "compilers have freedom for optimization" but they give warnings anyway so...
#include <iostream>
int main() {
int i = 0;
std::cout << i << " " << ++i << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment