Question 20
Back to Exercise
What does int a[3]; declared inside a function contain?
- A Three zeros
- B Indeterminate (garbage) values – reading them is undefined behaviour Correct
- C Three ones
- D It does not compile
Correct Answer: Option B
Write int a[3]{}; to zero it. Global and static arrays, by contrast, are zero-initialized automatically.
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!