944,155 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 820
  • C RSS
Nov 6th, 2009
0

Difference between *p[5] and (*p)[5]?

Expand Post »
I'm not sure about the difference between *p[5] and (*p)[5]?
Please help me clarify them?
Thanks a lot!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
thebluestar is offline Offline
55 posts
since Apr 2009
Nov 6th, 2009
0
Re: Difference between *p[5] and (*p)[5]?
It turns out that this can be done and that
int (*p1d)[5];

is the proper declaration, i.e. p1d here is a pointer to an array of 5 integers just as it was
under the declaration using the Array type. Note that this is different from

int *p1d[5];

which would make p1d the name of an array of 5 pointers to type int.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
thebluestar is offline Offline
55 posts
since Apr 2009
Nov 6th, 2009
0
Re: Difference between *p[5] and (*p)[5]?
Quote ...
which would make p1d the name of an array of 5 pointers to type int.
this one

  1. int *p1d[5];
Reputation Points: 34
Solved Threads: 4
Junior Poster
Iam3R is offline Offline
110 posts
since Oct 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Array counter
Next Thread in C Forum Timeline: classes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC