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

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

Prepare for the ultimate C++ challenge with our comprehensive quiz based on 'Thinking in C++'. Test your knowledge with engaging questions and receive instant feedback. Perfect for both beginners and experienced C++ programmers looking to sharpen their skills!

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 is the effect of a using declaration for a function name within a namespace scope?

  1. It imports the function into the global namespace

  2. It declares the function within the current scope

  3. It makes the function virtual

  4. It hides all other functions with the same name outside the namespace

The correct answer is: It declares the function within the current scope

A using declaration for a function name within a namespace scope does not import the function into the global namespace (answer A). Instead, it allows the function to be called within the current namespace without needing to specify the full namespace path every time. Option C is incorrect because a using declaration does not make the function virtual. Option D is incorrect because it only hides functions with the same name in the same namespace, not outside of it.