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

What is abstraction in oop with example?

0 Answers  


What is this interview room ? Is it a class or an object.

3 Answers   CybAge, NSN, Wipro,


Which keyword is written to use a variable declared in one class in the other class?

5 Answers   TCS,


write a progra in c++ using class & object to find out wheather a given no. is prim or not.

2 Answers  


Why do we need polymorphism in c#?

0 Answers  


What is the difference between encapsulation and polymorphism?

0 Answers  


Are polymorphisms mutations?

0 Answers  


Why multiple inheritance is not possible?

0 Answers  


The expansion of GNU

3 Answers  


Input: enter the value:1234 output: 1 2 3 4 write a program to get above output.....

4 Answers   Bally Technologies, IBM, SoftSol,


c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess

1 Answers   HCL, TCS,


What does it mean when someone says I oop?

0 Answers  


Categories