C
cplusplusquestion
There is a two-dimensional array:
int grades[MAX][MAX];
for( i = 0; i < MAX; i++)
for( j = 0; j < MAX; j++)
grades[j] = -1;
I would like to assign an another variable to this array, for example:
int another_grades[MAX][MAX];
for( i = 0; i < MAX; i++)
for( j = 0; j < MAX; j++)
another_grades[j] = grades[j];
Here, I need to declare another array. Is it possible to have a
pointer to point grades[MAX][MAX]? As I've tried:
int** another_g = grades;
it does not work. Any good idea?
int grades[MAX][MAX];
for( i = 0; i < MAX; i++)
for( j = 0; j < MAX; j++)
grades[j] = -1;
I would like to assign an another variable to this array, for example:
int another_grades[MAX][MAX];
for( i = 0; i < MAX; i++)
for( j = 0; j < MAX; j++)
another_grades[j] = grades[j];
Here, I need to declare another array. Is it possible to have a
pointer to point grades[MAX][MAX]? As I've tried:
int** another_g = grades;
it does not work. Any good idea?