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
What is an interface in oop?
what is graphics
What is use of overloading?
How do you achieve runtime polymorphism?
Why do while loop is used?
What is destructor oops?
What is abstract class in oops?
What is oops and why we use oops?
Can an interface inherit a class?
Can you inherit a private class?
What is encapsulation oop?
What is coupling in 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
What is difference between oop and pop?
What is object and example?