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...
Answer Posted / 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 |
Post New Answer View All Answers
Why do we use oop?
What is encapsulation example?
What is the problem with multiple inheritance?
What are the 4 pillars of oop?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
write knight tour problem which is present in datastructure
What is polymorphism in oops with example?
Why polymorphism is used in oops?
Why is oop better than procedural?
What are the three parts of a simple empty class?
What do you mean by Encapsulation?
What is overriding in oops?
Prepare me a program for the animation of train
What is destructor oops?
which feature are not hold visual basic of oop?