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

Question: 1 / 565

What is the effect of a using declaration for a function name within a namespace scope?

It imports the function into the global namespace

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.

Get further explanation with Examzify DeepDiveBeta

It makes the function virtual

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

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy