How can a '::' operator be used as unary operator?

Answer Posted / subham chaudhary

The scope operator can be used to refer to members of the global namespace. Because the global namespace doesn’t have a name, the notation :: member-name refers to a member of the global namespace. This can be useful for referring to members of global namespace whose names have been hidden by names declared in nested local scope. Unless we specify to the compiler in which namespace to search for a declaration, the compiler simple searches the current scope, and any scopes in which the current scope is nested, to find the declaration for the name.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are smart pointers?

672


What is a loop? What are different types of loops in c++?

595


Can a Structure contain a Pointer to itself?

608


What is #include math h in c++?

572


What is a buffer c++?

583






How do you differentiate between overloading the prefix and postfix increments?

590


What is a memory leak c++?

590


If dog is a friend of boy, is boy a friend of dog?

575


Which field is used in c++?

639


What is function prototyping? What are its advantages?

593


What is an arraylist c++?

687


What is else if syntax?

681


What are features of c++?

639


What is the syntax for a for loop?

602


What are the restrictions apply to constructors and destructors?

643