Discussion
Which of the following statements correct about k used in the below statement?
char ****k;
Answer: B
Correct answer: k is a pointer to a pointer to a pointer to a pointer to a char
Each asterisk adds one level of indirection, so four asterisks give four levels: k is a pointer to a pointer to a pointer to a pointer to char.
Counting the asterisks is the whole technique for reading such declarations. In practice more than two or three levels are rare outside argument-vector manipulation and certain data structures, and where they arise a typedef for the intermediate levels usually makes the code readable.
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