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 the problem with multiple inheritance?
What is the important feature of inheritance?
What is for loop and its syntax?
Can we create object of abstract class?
What is super in oop?
What are the benefits of interface?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
Get me a number puzzle game-program
What is oops and its features?
What is oops and why we use oops?
What is polymorphism in oops with example?
What are the 3 principles of oop?
Why multiple inheritance is not allowed?
Why it is called runtime polymorphism?
What is a null tree?