How to assign a two-dimensional array to ** pointer?

how to assign a two-dimensional array to ** pointer? this is the idea of ​​what i want to do

int arrray [2][3];
int **pointer = array;
so pointer[0][1]= 1;

so any help? thanks in advance

+5
source share
2 answers

The simple answer is that you cannot. A two-dimensional array is a contiguous block of memory that contains each row, while a pointer to a pointer can refer to a memory cell, where a pointer to another memory cell containing integers.

, , , (.. , pointer), , .

, , , , . ( ), . , .

+6

:

int (*pointer)[3] = array;

++. , ( ), , .

+16

All Articles