Mastering C++: 2025 All-In-One Quiz – Ace 'Thinking in C++' with Comprehensive Practice!

Question: 1 / 565

How does a using directive impact name visibility in namespaces?

It hides all other names outside the namespace

It makes all names within the namespace visible to its scope

The using directive is used to bring the names defined within a namespace into the current scope. This means that any names within the namespace will now be visible and accessible within the current scope. Option A is incorrect because it would hide all names, including the ones within the namespace. Option C is incorrect because it does not make the namespace itself invisible, it only hides the names within it. Option D is incorrect because importing names as private means they can only be accessed within the current file, not within the namespace. Therefore, the correct answer is B.

Get further explanation with Examzify DeepDiveBeta

It makes the namespace itself invisible outside its scope

It imports all names as private

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy