dynamic allocating array of arrays in C

后端 未结 7 938
南笙
南笙 2020-11-30 04:08

I don\'t truly understand some basic things in C like dynamically allocating array of arrays. I know you can do:

int **m;

in order to decla

7条回答
  •  感动是毒
    2020-11-30 05:04

    Using malloc(3) for allocate the first array and putting in there pointers created by malloc(3) should work with array[r][c] because it should be equivalent to *(*(array + r) + c), it is in the C standard.

提交回复
热议问题