+ 1
What is the use of two/multi dimensional arrays in c++?
2 odpowiedzi
+ 7
As far as I know.It only just Make your code to be reading easier
But whatever two or multi dimensional arrays
It will be translated into one dimension arrays
And sometimes it make your code not optimized
+ 4
It will just make it easier for you to represent matrices, cubes, etc using multi dimension arrays. Rest its all the same with normal arrays.
After all, no one prefers to do:
int matrix[row*col] , than int matrix[row][col].
And :
matrix[(row*i)+j] than matrix[i][j] to access the element a(i,j) in the matrix.