#include <iostream> using namespace std; int main() { if(true) int x = 10; cout<<"inside "<<x<<endl; cout<<"outside "<<x<<endl; return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:7:20: error: ‘x’ was not declared in this scope cout<<"inside "<<x<<endl; ^
Standard output is empty