?
What does the following declaration mean?
What does the following declaration mean?
int (*ptr)[10];
Answer & Solution
Correct Answer:
Option
B
The declaration int (*ptr)[10]; means that ptr is a pointer to an array of 10 integers.
Here's the breakdown:
int specifies the type of elements in the array (integers).
(*ptr) indicates that ptr is a pointer.
[10] specifies that the pointer points to an array of 10 integers.
Thus, ptr is not an array of pointers, nor an array of integers, but a pointer to an array of integers with a size of 10.
Here's the breakdown:
int specifies the type of elements in the array (integers).
(*ptr) indicates that ptr is a pointer.
[10] specifies that the pointer points to an array of 10 integers.
Thus, ptr is not an array of pointers, nor an array of integers, but a pointer to an array of integers with a size of 10.
Join the Discussion
Login to post a comment or share your explanation.
Login