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 abstraction in oop with example?
What is this interview room ? Is it a class or an object.
Which keyword is written to use a variable declared in one class in the other class?
write a progra in c++ using class & object to find out wheather a given no. is prim or not.
Why do we need polymorphism in c#?
What is the difference between encapsulation and polymorphism?
Are polymorphisms mutations?
Why multiple inheritance is not possible?
The expansion of GNU
Input: enter the value:1234 output: 1 2 3 4 write a program to get above output.....
4 Answers Bally Technologies, IBM, SoftSol,
c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess
What does it mean when someone says I oop?