For this assignment i am supposed to use a range for to print out the elements in ia without using the auto keyword. Basically the assignment is trying to help us understand multidimentional arrays. I have an idea of what is going on in the code but i keep running into some errors. There is something wrong with the syntax and i cant figure it out.
int ia[3][4] = {{0,1,2,3},{4,5,6,7},{8,9,10,11}};
cout << endl;
for(int &a : ia)
for(int b : a)
cout << b << endl;
I keep getting these errors:
..\src\Sec_3_5_3.cpp:127:15: error: invalid conversion from 'int*' to 'int' [-fpermissive] for(int &a : ia)
..\src\Sec_3_5_3.cpp:127:15: error: cannot bind rvalue '(int)((int*)__for_begin)' to 'int&'
..\src\Sec_3_5_3.cpp:128:15: error: 'begin' was not declared in this scope
..\src\Sec_3_5_3.cpp:128:15: error: 'end' was not declared in this scope