March 2018
Intermediate to advanced
183 pages
2h 34m
English
Namespaces are used to avoid naming conflicts by allowing entities, such as classes and functions, to be grouped under a separate scope. In the following code, there are two classes that belong to the global scope. Since both classes share the same name and scope, the code will not compile.
One way to solve this problem is to rename one of the conflicting classes. Another solution is to group one or both of them under a different namespace by enclosing each in a namespace block. The classes then belong to different scopes ...