fork(10) download
  1. #include <iostream>
  2.  
  3. int i = 0;
  4. int main() {
  5. int i = 1;
  6. for (int i = 0; i < 10; ++i) {
  7. int i = 2 * i;
  8. std::cout << i << std::endl;
  9. }
  10. return 0;
  11. }
  12.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:17: error: redeclaration of ‘int i’
             int i = 2 * i;
                 ^
prog.cpp:6:18: error: ‘int i’ previously declared here
         for (int i = 0; i < 10; ++i) {
                  ^
prog.cpp:5:13: warning: unused variable ‘i’ [-Wunused-variable]
         int i = 1;
             ^
stdout
Standard output is empty