What is the use of unnamed namespaces in OOPS?
The only advantage I know is that they dont need the scope
resolution operator while accessing them. I want to know
some other advantages of unnamed namespaces...

Answers were Sorted based on User's Feedback



What is the use of unnamed namespaces in OOPS? The only advantage I know is that they dont need the..

Answer / santosh mundhe

Another advantage is that u can extend namespace within the
same file ....

E.g
#include <iostream>

using namespace std;

namespace
{
int myval;
void funct (int);
}

namespace
{
void funct (int i)
{
cout << i << endl;
}
}

int main()
{
funct(myval);
return 0;
}

Is This Answer Correct ?    1 Yes 0 No

What is the use of unnamed namespaces in OOPS? The only advantage I know is that they dont need the..

Answer / c++ coder

in addition to the advantage mentioned above , there is one
more that the namespace is local to the file and one cannot
use it into another by 'using namespace' since it is
unnamed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

Is html an oop?

0 Answers  


Is data hiding and abstraction same?

0 Answers  


what are the characteristics of oops?

7 Answers   NIIT,


What does sksksk mean in text slang?

0 Answers  


what is graphics

0 Answers  






What is the importance of oop?

0 Answers  


what is difference between c++ language and java language

5 Answers  


write a programe to calculate the simple intrest and compund intrest using by function overlading

0 Answers  


what are three tenets of object orinted Systems?Why they call like that ? Please answer me. Advance thanks.

2 Answers   Excel,


What is the difference between encapsulation and polymorphism?

0 Answers  


Explain polymorphism? What r the types of polymorphism? pls give examples?

4 Answers   HCL,


What is pure oop?

0 Answers  


Categories