Main.cc: In function ‘int main()’: Main.cc:27:16: error: redeclaration of ‘int i’ int h, i; ^ Main.cc:26:14: note: ‘int i’ previously declared here for (int i = 0; i < f; ++i) { ^