Name space | Sololearn: Learn to code for FREE!


Name space

How-to use name space

12/3/2020 6:30:53 AM


3 Answers

New Answer


SAHIL Try to elaborate for what you are exactly asking for.. in which language you are asking for... ~try to use Google advanced search sometimes, coz it might help.. "Try to clear your question" Follow community guidelines -


It would be better if you have declared the language tag you need help. As you didn't mention the programming language I think you need help in c++ programming language . From this page: Consider a situation, when we have two persons with the same name, Zara, in the same class. Whenever we need to differentiate them definitely we would have to use some additional information along with their name, like either the area if they live in different area or their mother or father name, etc. Same situation can arise in your C++ applications. For example, you might be writing some code that has a function called xyz() and there is another library available which is also having same function xyz(). Now the compiler has no way of knowing which version of xyz() function you are referring to within your code. A namespace is designed to overcome this difficulty and is used as additional information to differentiate similar functions, classes, variables etc. with the same name available in different libraries. Using namespace, you can define the context in which names are defined. In essence, a namespace defines a scope. I have copied it from the comment as I think you didn't read the comment .Whenever you don't understand the lesson please have a look at the comment.

+1 Read the comments by the community. They teach you a lot.