Main.cc: In function 'int main()': Main.cc:16:16: warning: statement has no effect [-Wunused-value] a[i][i]+m; ^ Main.cc:21:5: error: expected ';' before 'for' for(int i=0;i