Main.cc: In function ‘int main()’: Main.cc:15:9: error: ‘b’ was not declared in this scope cin>>b[i][j]; ^ Main.cc:20:16: error: ‘b’ was not declared in this scope if(a[i][j]==b[i][j]){ ^