InterviewSolution
Saved Bookmarks
| 1. |
How can a '::' operator be used as unary operator? |
|
Answer» The scope resolution 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. |
|