What is the output of this code ?
#include <iostream> using std::cout, std::endl; int main() { int i = 1; { int i = 2; i += 1; } cout << i << endl; }
1
2
that’s an undefined behavior
nothing, it produces a compilation error