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 are the two types of comments, and how do they differ?

787


What is the use of ::(scope resolution operator)?

844


What are the unique features of C++.

782


What is the difference between public and private data members?

897


What is the full form of dos?

781


What is the C-style character string?

823


What is the cout in c++?

784


What is bubble sort c++?

779


How do you remove an element from a set in c++?

832


What is the difference between ++ count and count ++?

841


What are the effects after calling the delete this operator ?

813


What is the purpose of extern storage specifier?

841


Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D

3401


What is a flag in c++?

820


why is iostream::eof inside a loop condition considered wrong?

828