Question 2
Back to Exercise
What is the value of int total; declared outside all functions, before it is assigned?
- A Garbage
- B 0 Correct
- C 1
- D It does not compile
Correct Answer: Option B
Variables with static storage duration – globals and static locals – are zero-initialised before main() runs (pointers become NULL, doubles 0.0).
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!