C Programming - Complicated Declarations - Discussion

Discussion Forum : Complicated Declarations - General Questions (Q.No. 2)
2.
What do the following declaration signify?
int *ptr[30];
ptr is a pointer to an array of 30 integer pointers.
ptr is a array of 30 pointers to integers.
ptr is a array of 30 integer pointers.
ptr is a array 30 pointers.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
12 comments Page 2 of 2.

Tejas said:   6 years ago
A should be the answer. Because ptr is a pointer to an array of thirty integers.

Omka akash said:   5 years ago
int *ptr[30]; (array of pointrs)=> ptr is array of 30 integer pointers.
Because square braces having more priority than * operator.

int (*ptr)[30];(pointer to an array)=> ptr is a pointer pointing to an array of 30 integers.
(1)


Post your comments here:

Your comments will be displayed after verification.