The two declarations are as follows:
int (*p)[8];
int *p[8];
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The first is a single pointer to an array of 8 integers, while the second is an array of 8 pointers, each to an integer.
If you just kick up
cdecl, it’s wonderful for this sort of thing:There’s actually a clockwise/spiral rule you can use to do this in your head but I haven’t had to worry about that since I discovered
cdecl, for the same reason I no longer convert large arbitrary 32 bit numbers from decimal to hex in my head any more – I can if I have to but it’s so much easier with a tool 🙂