Main.cc: In function 'int main()': Main.cc:7:10: error: 'i' was not declared in this scope cin>>b[i]; ^