The risk of using the 'using namespace' statement

While ‘using namespace’ can be useful in small programs, using a multiude of different namespaces can cause naming issues. The reason namespaces are used and are useful is because they ensure that no two functions with the same name declared in different namespaces can clash with each other, so you can have functions with the same name that do different things with different namespaces, and the compiler will know which function you’re referring to. ‘using namespace’ gets rid of this feature.

Privacy & Terms