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(i nt) *ROW_SIZE*COL_S IZE);
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(i nt) *ROW_SIZE*COL_S IZE);
arr[i *COLUMN_SIZE + j];
will this only work for square arrays or all two-dim arrays ? Thanks :)
Sona
Comment