// scope.cc #include //using namespace std; using std::cout; using std::endl; int main() { double x = 1.2; cout << "in main before scope, x: " << x << endl; { // just a local scope x++; cout << "in local scope before int, x: " << x << endl; int x = 4; cout << "in local scope after int, x: " << x << endl; } cout << "in main after local scope, x: " << x << endl; return 0; }