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 |
Difference between vector and array
can we make game by using c
What is overriding vs overloading?
is java purely oop Language?
49 Answers HCL, Infosys, TCS,
how many types of notations are in java
1 Answers National University of Modern Languages (NUML),
which are the 4 members functions in c++ objects that can either be declared explicitly by programmer or implementation if nt available.
what is the main difference between sizeof() operator in c and c++
Can we call a base class method without creating instance?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
What is methods in oop?
What is oops in simple words?
What is object and class in oops?