What does the following declaration mean? int (*ptr)[10];
What does the following declaration mean?
int (*ptr)[10];
Answer: B. ptr is a pointer to an array of 10 integers — int (*ptr)[10]; - ptr is a pointer to an array of 10 integers Explanation: The parentheses around *ptr indicate that ptr is a pointer. The [10] after the…
- A.
ptr is array of pointers to 10 integers
- B.
ptr is a pointer to an array of 10 integers
- C.
ptr is an array of 10 integers
- D.
ptr is an pointer to array
Attempted by 304 students.
Show answer & explanation
Correct answer: B
int (*ptr)[10]; - ptr is a pointer to an array of 10 integers
Explanation:
The parentheses around *ptr indicate that ptr is a pointer.
The [10] after the parentheses applies to the array being pointed to, not to ptr itself.
Thus, ptr is a pointer to an array of 10 integers.
Loading lesson…