I got a question in a challenge of C++:
(Both opponents at 4-4)
What is the purpose of a namespace?
//By some Ben
1) access a library
2) naming a file
But here, both answers are wrong as the use of a namepace is not this, and the std library is accessed using 'using'!
A namespace is for scoping particular data...
Eg: A's program and B's code...
So, I lost 32 xp thanks to this.
The question now is, how can SoloLearn approve this? Why reject my questions if you can approve incorrect ones?
Namespaces provide a method for preventing name conflicts in large projects.
Symbols declared inside a namespace block are placed in a named scope that prevents them from being mistaken for identically-named symbols in other scopes.
Multiple namespace blocks with the same name are allowed. All declarations within those blocks are declared in the named scope.