Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Disable ads (and more) with a membership for a one time $2.99 payment

Test your C++ skills with our quiz based on Bruce Eckel's 'Thinking in C++'. Dive into object-oriented programming, advanced topics, and fundamentals. Perfect for learners and experts alike. Assess your knowledge and become a C++ master!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What does 'extern' keyword indicate when used with a const variable?

  1. The variable is defined externally

  2. External linkage

  3. No storage is allocated

  4. The variable is a constant expression

The correct answer is: External linkage

The 'extern' keyword with a const variable indicates external linkage. This means that the variable can be used and accessed from other files. Choice A is incorrect because the 'extern' keyword does not necessarily mean that the variable is defined externally, it just indicates external linkage. Choice C is incorrect because storage is still allocated for the variable, even if it has external linkage. Choice D is incorrect because a const variable with the 'extern' keyword is not necessarily a constant expression, it just has external linkage.