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 integersint (*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…

  1. A.

    ptr is array of pointers to 10 integers

  2. B.

    ptr is a pointer to an array of 10 integers

  3. C.

    ptr is an array of 10 integers

  4. 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.

Explore the full course: Isro

Loading lesson…