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...
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / c++ coder
in addition to the advantage mentioned above , there is one
more that the namespace is local to the file and one cannot
use it into another by 'using namespace' since it is
unnamed.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is polymorphism and why is it important?
What is a scope operator and tell me its functionality?
What is abstraction encapsulation?
Why static Function is used in C++?
program in c++ that can either 2 integers or 2 floating point numbers and output the smallest number
What is encapsulation in ict?
Can bst contain duplicates?
What is virtual Function.
What is an object?
what is difference between String s=new String("vali"); String s="vali"
What do we mean by a hidden argument in a function?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.