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: What is the...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 6 Topic 26056 of 26821
Post > Topic >>

Re: What is the difference between: int a (*daytab)[13] and int a *daytab[13]

by santosh <santosh.k83@[EMAIL PROTECTED] > May 5, 2008 at 02:16 AM

Ben Bacarisse wrote:

> santosh <santosh.k83@[EMAIL PROTECTED]
> writes:
> 
>> magicman wrote:
>>
>>> What is the difference  between:  int a (*daytab)[13] and  int a
>>> *daytab[13]
>>> thx
>>
>> In a declaration the first one declares daytab as a pointer to an
>> array of 13 ints. The second declares daytab as an array of 13 int*.
> 
> I guess you are ignoring the "a" in both!

Oops! I'm starting to really believe the research indications that the
brain "reads" what it "wants to read", or "completes" sentences from
partially reading them. Thanks once again for the correction.

>> For the first one
>>
>>   daytab[n]
>>
>> will be of type int
> 
> It will be of type "array of 13 int".  It will be converted to an int
> pointer in most contexts hence, I suspect, the confusion.
> 
>> and for the second one
>>
>>   daytab[n]
>>
>> will be of type int*.
> 
> Yes, in both cases daytab[n] could be further subscripted or passed to
> function that expects and int *.
>
 




 6 Posts in Topic:
What is the difference between: int a (*daytab)[13] and int a
magicman <ironsel2000@  2008-05-04 11:49:22 
Re: What is the difference between: int a (*daytab)[13] and int
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-04 11:59:54 
Re: What is the difference between: int a (*daytab)[13] and i
"Bartc" <bc@  2008-05-04 19:03:49 
Re: What is the difference between: int a (*daytab)[13] and i
santosh <santosh.k83@[  2008-05-05 01:27:45 
Re: What is the difference between: int a (*daytab)[13] and i
Ben Bacarisse <ben.use  2008-05-04 21:42:14 
Re: What is the difference between: int a (*daytab)[13] and i
santosh <santosh.k83@[  2008-05-05 02:16:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Wed Jul 9 1:05:51 CDT 2008.