Discussion
What’s the meaning of following declaration in C language?
int (*p)[5];
Answer: D
Correct answer: p is a pointer to an array of 5 integers
The parentheses are what matter. int (*p)[5] binds the asterisk to p first, so p is a pointer, and what it points to is an array of five int. Without them, int *p[5] would be an array of five pointers - the same tokens in a different grouping giving a completely different type.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development