S
Sona
Please could someone tell me how to use a single-dimensional array as a
two-dimensional array? Is the following correct:
int ROW_SIZE = 5;
int COL_SIZE = 3;
int *arr = (int*) malloc(sizeof(int) *ROW_SIZE*COL_SIZE);
arr[i *COLUMN_SIZE + j];
will this only work for square arrays or all two-dim arrays ? Thanks
Sona
two-dimensional array? Is the following correct:
int ROW_SIZE = 5;
int COL_SIZE = 3;
int *arr = (int*) malloc(sizeof(int) *ROW_SIZE*COL_SIZE);
arr[i *COLUMN_SIZE + j];
will this only work for square arrays or all two-dim arrays ? Thanks
Sona