Main.cc: In function 'int main()': Main.cc:7:5: error: redeclaration of 'int n' int n,b; ^ Main.cc:4:5: note: 'int n' previously declared here int n; ^