Can someone explain to me the difference between:
int *arr[5] vs. int (*arr)[5] vs. int *(*arr)[5]
I’m trying to wrap my mind around how pointers/arrays are actually represented in C…
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.
I would suggest using http://cdecl.org.
int *arr[5]“declare arr as array 5 of pointer to int”int (*arr)[5]“declare arr as pointer to array 5 of int”int *(*arr)[5]“declare arr as pointer to array 5 of pointer to int”plus a visit to this page from MSDN: Interpreting more complex declarators.