fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int b = 2;
  6. if (int a = 0) {
  7. }
  8. else {
  9. int a;
  10. }
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:9:9: error: redeclaration of ‘int a’
     int a;
         ^
prog.cpp:6:11: note: ‘int a’ previously declared here
   if (int a = 0) {
           ^
stdout
Standard output is empty