Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > Point to a two-...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 4103 of 4218
Post > Topic >>

Point to a two-dimension array

by cplusplusquestion@[EMAIL PROTECTED] Apr 10, 2008 at 11:25 PM

There is a two-dimensional array:

int grades[MAX][MAX];
for( i = 0; i < MAX; i++)
   for( j = 0; j < MAX; j++)
      grades[i][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[i][j] = grades[i][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?
 




 4 Posts in Topic:
Point to a two-dimension array
cplusplusquestion@[EMAIL   2008-04-10 23:25:52 
Re: Point to a two-dimension array
Richard Heathfield <rj  2008-04-11 07:05:20 
Re: Point to a two-dimension array
Barry Schwarz <schwarz  2008-04-11 21:47:42 
Re: Point to a two-dimension array
Bart van Ingen Schenau &l  2008-04-18 15:00:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 19:32:53 CDT 2008.