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 oops
What is destructor example?
What is the difference between encapsulation and polymorphism?
What is interface? When and where is it used?
How can i write a code in c# to take a number from the user and then find all the prime numbers till the number entered by the user.
WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP
what is the realstic modeling?
How to calculate the age from the date of birth by using the program?
How to overload new operator in c++
Child cObj = new Parent() Wahts the output ?
create a class complex having real and imaginary part of a complex no. as a data member. overload the binary operators(+,- and *) to perform the operations on complex no. objects. overload binary operator using friend function.
2 Answers CTS, Delhi University,
The IT giant Tirnop has recently crossed a head count of 150000 and earnings of $7 billion. As one of the forerunners in the technology front, Tirnop continues to lead the way in products and services in India. At Tirnop, all programmers are equal in every respect. They receive identical salaries and also write code at the same rate. Suppose 14 such programmers take 14 minutes to write 14 lines of code in total. How long will in take 5 programmers to write 5 lines of code in total ?