Basic question.. had to ask. Any help will be appreciated.
Q: Why can’t I dereference the pointer to a multidimensional array like this:
int arr [2][2] = { {1, 2} , {3, 4} };
printf("%d ", *arr);
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.
You can dereference it, it is just that the result is not going to be what you’d expect:
*arris not anint, it’s a pointer to anint(OK, a one-dimensional array). If you want to see1printed, add another star: