#include <iostream> int i = 0; int main() { int i = 1; for (int i = 0; i < 10; ++i) { int i = 2 * i; std::cout << i << std::endl; } return 0; }
Standard input is empty
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; ^
Standard output is empty