I want to know how to malloc for a 2d array. I have the code for a single dimension array.
int size;
int* array;
array = (int*)malloc(si ze*sizeof(int)) ;
the user will input a number for 2 variables so size1 and size2. One amount for the columns and one for the rows. With the code above its only for one of these.
int size;
int* array;
array = (int*)malloc(si ze*sizeof(int)) ;
the user will input a number for 2 variables so size1 and size2. One amount for the columns and one for the rows. With the code above its only for one of these.
Comment