int matrix[9][9],*p;
p=matrix[0];
this works and gives first row of matrix
, but how to get first column of matrix
I've tried p=matrix[][0];
? Also I don't understand why below code gets compiler error ?
int matrix[9][9],p[9]; // it looks really ugly, byt why it doesn't work ?
p=matrix[0]; // compiler gives "invalid array assigment"
is it because multidimensional arrays are arrays of arrays - and we should interpret matrix[i][j]
as j-th element of i-th nested array ?