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 > Re: First addre...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 26102 of 26960
Post > Topic >>

Re: First address of a bidimensional array

by "Default User" <defaultuserbr@[EMAIL PROTECTED] > May 7, 2008 at 05:04 PM

nembo kid wrote:

> I have the following bidimensional array
> 
> int a [100][100];

I assume you mean "mat" here, to be consistent with what follows.

> Why the first address of this array is only:
> 
> & (mat[0][0])

It's not. That's the first element of the first element. 

> and not also:
> 
> mat

That gives you the address of the first element. The first element is
an array of int of size 100.

> like any other array?

It is like any other array. You just don't understand how it works. The
name of the array in most cir***stances is converted to a pointer to
the first element. So "mat" is of type "pointer to array 100 of int",
and points to the beginning of mat[0].

I recommend reading over the FAQ entries on pointers and arrays.




Brian
 




 5 Posts in Topic:
First address of a bidimensional array
nembo kid <user@[EMAIL  2008-05-07 16:12:06 
Re: First address of a bidimensional array
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-07 07:24:22 
Re: First address of a bidimensional array
S S <sarvesh.singh@[EM  2008-05-07 09:36:21 
Re: First address of a bidimensional array
"Default User"   2008-05-07 17:04:42 
Re: First address of a bidimensional array
Chris Torek <nospam@[E  2008-05-07 21:48:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Thu Jul 24 16:43:09 CDT 2008.