int mat[r][c];
mat[i][j] = *(*(mat+i) + j) ???
here mat is a pointer to an array of r elements and each elementof mat itself is an array of c elements
then in mat +i ,i gets scaled by c*sizeof(int) thus mat+i is starting address of ith row and then dereferencing it yields first element of ith row but looking at this expression it seems that *(mat + i) is also treated as a address
please help on understanding this way of accessing array elements of multidimensiona l array
mat[i][j] = *(*(mat+i) + j) ???
here mat is a pointer to an array of r elements and each elementof mat itself is an array of c elements
then in mat +i ,i gets scaled by c*sizeof(int) thus mat+i is starting address of ith row and then dereferencing it yields first element of ith row but looking at this expression it seems that *(mat + i) is also treated as a address
please help on understanding this way of accessing array elements of multidimensiona l array
Comment