fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. for (int i =0 ; i != 5 ; i++) {
  6. int i = 10;
  7. printf("%d\n", i);
  8. }
  9. return 0;
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:6:7: error: redeclaration of ‘int i’
   int i = 10;
       ^
prog.cpp:5:11: note: ‘int i’ previously declared here
  for (int i =0 ; i != 5 ; i++) {
           ^
stdout
Standard output is empty