Scope resolution operator - Resolve scope of global variables as well as functions of the classes

Q.  C++: Scope resolution operator is used______
- Published on 24 Jun 15

a. To resolve the scope of global variables only
b. To resolve the scope of functions of the classes only
c. To resolve scope of global variables as well as functions of the classes
d. None of these

ANSWER: To resolve scope of global variables as well as functions of the classes
 
The Scope resolution operator(::) is used to define a function outside a class or when we want to use a global variable but which also has a local variable with same name.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)