Answers for "malloc contiguous 2d array"

C
0

malloc contiguous 2d array

int **A = malloc(ROWS * sizeof(int*));
A[0] = malloc(ROWS * COLS * sizeof(int));
for(int i = 1; i < ROWS; i++) 
   A[i] = A[i-1] + COLS;
// use A[i][j]
Posted by: Guest on October-19-2021

Code answers related to "C"

Browse Popular Code Answers by Language