What problem does the namespace feature solve?



What problem does the namespace feature solve?..

Answer / nimish singh

Multiple providers of libraries might use common global identifiers causing a name collision when an application tries to link with two or more such libraries. The namespace feature surrounds a library's external declarations with a unique namespace that eliminates the potential for those collisions.

This solution assumes that two library vendors don't use the same namespace identifier, of course.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What does override mean in c++?

0 Answers  


Does c++ have finally?

0 Answers  


What are the different data types present in C++?

4 Answers  


Write about the role of c++ in the tradeoff of safety vs. Usability?

0 Answers  


class X { public: int x; static void f(int z); }; void X::f(int y) {x=y;} What is the error in the sample code above? a) The class X does not have any protected members. b) The static member function f() accesses the non-static z. c) The static member function f() accesses the non-static x. d) The member function f() must return a value. e) The class X does not have any private members.

2 Answers   Quark,


What is a loop? What are different types of loops in c++?

0 Answers  


What is constructor c++?

0 Answers  


Write an algorithm that determines whether or not an almost complete binary tree is a heap.

0 Answers   TCS,


What is flush c++?

0 Answers  


If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?

0 Answers  


What are the characteristics of friend functions?

0 Answers  


What is the use of volatile variable?

0 Answers  


Categories