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

Thread Solved

Join Date: Apr 2009
Posts: 28
Reputation: thebluestar is an unknown quantity at this point 
Solved Threads: 0
thebluestar thebluestar is offline Offline
Light Poster

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

 
0
  #1
22 Days Ago
I'm not sure about the difference between *p[5] and (*p)[5]?
Please help me clarify them?
Thanks a lot!
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 28
Reputation: thebluestar is an unknown quantity at this point 
Solved Threads: 0
thebluestar thebluestar is offline Offline
Light Poster
 
0
  #2
22 Days Ago
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 46
Reputation: Iam3R is an unknown quantity at this point 
Solved Threads: 2
Iam3R Iam3R is offline Offline
Light Poster
 
0
  #3
22 Days Ago
which would make p1d the name of an array of 5 pointers to type int.
this one

  1. int *p1d[5];
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC