What is the meaning of the following declaration in C programming language?…

2018

What is the meaning of the following declaration in C programming language? int (*p)[5];

  1. A.

    It will result in compile error because there should not be any parenthesis, i.e., int *p[5] is valid

  2. B.

    p is a pointer to 5 integers

  3. C.

    p is a pointer to integer array

  4. D.

    p is a pointer to an array of 5 integers

Attempted by 342 students.

Show answer & explanation

Correct answer: D

Key idea: int (*p)[5] declares p as a pointer to an array of 5 integers. Parentheses around *p make p a pointer; [5] applies to the type pointed to, so p points to an array of 5 int values.

Explore the full course: Up Lt Grade Assistant Teacher 2025