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 Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
Can you explain polymorphism?
What is abstraction in oops with example?
Is react oop?
What is abstraction in oops?
What are objects in oop?
What is encapsulation c#?
What is the difference between static polymorphism and dynamic polymorphism?
What is solid in oops?
What are main features of oop?
What is abstraction in oop?
What is encapsulation process?
How is polymorphism achieved?
Can we create object of interface?
How to hide the base class functionality in Inheritance?