int *x = new int[5]();
With the above mentality, how should the code be written for a 2-dimensional array - int[][]
?
int **x = new int[5][5] () //cannot convert from 'int (*)[5]' to 'int **'
In the first statement I can use:
x[0]= 1;
But the second is more complex and I could not figure it out. Should I use something like:
x[0][1] = 1;
Or, calculate the real position then get the value for the fourth row and column 1
x[4*5+1] = 1;