Main.cc: In function ‘int main()’: Main.cc:16:6: error: invalid types ‘int[int]’ for array subscript r[a]++; ^ Main.cc:17:9: error: invalid types ‘int[int]’ for array subscript if(r[a]==1) r++; ^