Question 7
Back to Exercise
A program registers atexit(a) and then atexit(b). In what order do they run at exit?
- A a then b
- B b then a Correct
- C Only b
- D In an unspecified order
Correct Answer: Option B
Handlers run in reverse order of registration, like a stack – so things set up later are torn down first.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!