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 it is called runtime polymorphism?
What are properties in oop?
What are two types of polymorphism?
What is difference between oop and pop?
What is abstraction in oops?
What does and I oop mean in text?
Can static class have constructor?
when to use 'mutable' keyword and when to use 'const cast' in c++
Can we override main method?
what is different between oops and c++
Why multiple inheritance is not allowed?
What is abstraction oop?
What is the diamond problem in inheritance?
Can we create object of interface?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?