Question:
In C++ programming, what is the purpose/use of the word "NAMESPACE"?
nevikenezer
2006-11-08 17:45:20 UTC
please answer it seriously!
Four answers:
Alex T
2006-11-12 00:46:15 UTC
The main customer scenario this originally addressed is someone using a 3rd party library would be picking up a lot of code unknown to the developer, and there would often be naming conflicts between the developer's classes and the library's. Similar problem in the .NET framework, which has a massive set of classes (for instance, there are two Timer classes, one in System.Timers and one in System.Threading).
ProTechHosting.net
2006-11-08 18:07:24 UTC
A namespace is nothing more than a way to help keep things organized and reusable, and to break up your code a little. It's not an object like a class or anything like that, although the syntax is similar. One use of a namespace would be when you are writing a set of functions in say, a library that you will be distributing, and you are going to be using function/class names that could conflict with already existing code, perhaps "set", "get", and "exit".
Scooter_MacGyver
2006-11-08 17:54:19 UTC
there are so many classes in c++, that if one software deverloper writes a program and another modifies it, there may be a naming conflict. So we put them in a namespace, e.g. the std namespace tells the compiler what cin >> and cout << really mean.
anonymous
2016-11-29 03:46:22 UTC
you want to come across a thanks to make confident that spaceOne isn't continually equivalent to spaceTwo like that is on your implementation. i trust that is all you want, yet i did not try it: spaceTwo = sentence.locate(' ', spaceOne+a million);


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...