Discussion
Which of the following is true of external variables?
Answer: D
Correct answer: All of the above
All three statements describe external variables. Because any function can read and write them, they provide a channel of communication in both directions between functions without passing arguments or returning values.
Their scope runs from the point of definition to the end of the translation unit, and beyond it in files that declare them extern. Having static storage duration, they are zero-initialised if no initialiser is given. The convenience is real but so is the cost: shared mutable state is the hardest kind of code to reason about.
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