Discussion
For the following function call which option is not possible? func(&s.a); //where s is a variable of type struct and a is the member of the struct.
Answer: A
Correct answer: Compiler can access entire structure from the function
func(&s.a) passes the address of one member only. The function receives a pointer to that member and has no way to reach the rest of the structure - it does not even know what structure the member belongs to. To give it the whole thing you would pass &s.
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