Main.cc: In function ‘int main()’: Main.cc:6:9: error: ‘i’ was not declared in this scope cin>>q[i]; ^