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 cohesion in oop?
Can destructor be overloaded?
Why we use classes in oop?
write a program to find 2^n+1 ?
What is destructor oops?
Why it is called runtime polymorphism?
What is abstraction in oop with example?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What is polymorphism in oops with example?
What is encapsulation with real life example?
What is the difference between inheritance and polymorphism?
What is byval and byref? What are differences between them?
Why is static class not inherited?
What is interface? When and where is it used?
What is the difference between a constructor and a destructor?