#include <iostream> using namespace std; int main() { for (int i =0 ; i != 5 ; i++) { int i = 10; printf("%d\n", i); } return 0; }
Standard input is empty
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++) {
^
Standard output is empty