fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. if (true) int x = 42;
  6. std::cout << x << '\n';
  7. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:5:18: warning: unused variable ‘x’ [-Wunused-variable]
prog.cpp:6:17: error: ‘x’ was not declared in this scope
stdout
Standard output is empty