C Programming - Complicated Declarations - Discussion
Discussion Forum : Complicated Declarations - General Questions (Q.No. 2)
2.
What do the following declaration signify?
int *ptr[30];
Discussion:
12 comments Page 2 of 2.
Utkarsh said:
6 years ago
In declaration:
int p[20][30]; -> 20 elements each of which is an array of 30 ints.
is equivalent to int *p[30];
So, p is a pointer to an array of 30 ints.
int p[20][30]; -> 20 elements each of which is an array of 30 ints.
is equivalent to int *p[30];
So, p is a pointer to an array of 30 ints.
Tejas said:
6 years ago
A should be the answer. Because ptr is a pointer to an array of thirty integers.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers