C++ How To Program Plus Mylab Programming With Pearson Etext -- Access Card Package (10th Edition)
Question
Book Icon
Chapter 9, Problem 9.3E
Program Plan Intro

Scope Resolution Operator:

In C++, the double colon “::” is called scope resolution operator. The purpose of the scope resolution operator is:

Expert Solution & Answer
Check Mark

Explanation of Solution

Explanation:

  • If, in a program, there is a local variable with the same name as global variable, then while compiling, the complier uses the local variable. In order to access the global variable, user must prefix the variable name with “:: variable name”.
  • To define a function outside a class.
  • If user wants to access static variables of a class.
  • If, in two classes, there are same variable names, then, to distinguish, scope resolution operator is used. That means, for multiple inheritance, scope resolution operator is used.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Define the term " operator equal " .
What are the benefits of using a function?
How does the use of a function help?
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning