Discussion
What does the following declaration mean ? int (*ptr) [10];
Answer: B
The declaration int (*ptr)[10]; means that ptr is a pointer to an array of 10 integers. The parentheses bind the star to ptr first, so ptr is a pointer, and the [10] then describes the thing it points to.
An array of 10 pointers to integers would be written int *ptr[10], without the parentheses. A plain array of 10 integers would be int ptr[10]. Since the declaration is a valid one with a clear meaning, 'none of the above' is wrong.
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