Q:

Why is “using namespace std;” considered bad practice in c++?

0

Why is “using namespace std;” considered bad practice in c++?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

We should always avoid including namespace and call the function followed by the namespace name. Let’s assume you want to display something on console then you should write the code in the below format,

std::cout << "Aticleworld.com";

The reason behind that it helps to avoid ambiguity when two included namespaces have the function of the same name.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions For Experienced

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Why can templates only be implemented in the heade... >>
<< Could you write an example code that describes the...