Question 4
Back to Exercise
What does extern int x; at file scope do?
- A Defines x and sets it to 0
- B Declares x, which must be defined somewhere else in the program Correct
- C Creates a local copy of x
- D Makes x constant
Correct Answer: Option B
extern without an initializer only announces the name and type; no storage is created. Exactly one file must contain the definition (int x; or int x = 5;), or linking fails.
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!