Main.cc: In function ‘int main()’: Main.cc:10:7: error: ‘i’ was not declared in this scope if(a[i]==a[2]){ ^