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.


In C++, what does the `extern` keyword indicate when used with a function declaration?

  1. The function is defined in another file

  2. The function will not throw any exceptions

  3. The function takes a variable number of arguments

  4. The function returns an external type

The correct answer is: The function is defined in another file

The `extern` keyword in C++ is used to indicate that the function is defined in another file. This means that the function is declared in one file but defined in another file, allowing for code reusability and modularity. Option B is incorrect because `extern` has nothing to do with exception handling. Option C is incorrect because the `extern` keyword is used with function declarations, not definitions, and has no impact on the number of arguments a function takes. Option D is incorrect because the `extern` keyword does not specify the return type of a function.