Discussion
int i = 5; is a statement in a C program.
Answer: C
Correct answer: repeated execution may result in different addresses for i
The declaration int i = 5; inside a function creates an object with automatic storage duration: it is allocated when the block is entered and released when it is left.
Nothing fixes where. A recursive call, a different call path, or simply a different run of the program can place it at a different address, and modern systems randomise the stack deliberately. Within a single lifetime the address is stable and the value may change; across lifetimes neither the address nor the value carries over.
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