LearnFrenzy
Sign in Take a free test

Declarations and Initializations · Declarations MCQ · Question 1

Which of these is a declaration but not a definition? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 1 Back to Exercise

Which line only declares a variable, without defining it?

  • A int count = 0;
  • B extern int count; Correct
  • C static int count;
  • D int count; (inside a function)
Correct Answer: Option B

extern without an initializer announces that count is defined elsewhere; no storage is created. The other lines all create the variable.

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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links