[prog] Doubts in C

Daniel. cristofd at hevanet.com
Fri Aug 29 02:49:47 EST 2003


>Can somebody explain to me what is the difference between (if any)
>int (*a)[10]  and
>int *a[10]

According to K&R 2nd ed. pg. 122, the first is of type "pointer to 
array[10] of int" (i.e. you would set it to point to some array of 10 
ints) whereas the second is of type "array[10] of pointer to int" 
i.e. it's an array of 10 pointers.
-Daniel.
-- 
        ()  ASCII ribbon campaign      ()    Hopeless ribbon campaign
        /\    against HTML mail        /\  against gratuitous bloodshed


More information about the Programming mailing list