what is the use of Namespace in c++.

Answer Posted / ramprasad g

The use of namespace is to avoid clash during naming of
variable,classes etc.

Suppose a company wants to release its version of a
function, it can create a separate namespace and then create a
function within that namespace.Another company can create a
function of same name, as long as it is in different
namespace.And the third company can use both the functions
in the same program by using resolving the namespace.


pakage concept of Java is a similar idea.

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is extern c++?

758


How do I use arrays in c++?

793


Define basic type of variable used for a different condition in C++?

897


Why is c++ is better than c?

741


Should I learn c++ c?

847


Does c++ support exception handling?

832


What are formatting flags in ios class?

880


What is a storage class? Mention the storage classes in c++.

807


What is a block in c++?

821


Why is c++ so fast?

777


Explain Text Manipulation Routines?

867


Who calls main function?

829


What is ofstream c++?

860


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

828


What do the keywords volatile and mean mutable?

826