Question:

Which of the following operators is known as scope resolution operator ?

Show Hint

Think of `::` as a way to say "the version of this thing that belongs to that scope". For example, `MyClass::myFunc` means "the `myFunc` that belongs to the `MyClass` scope".
  • ::
  • ?:
  • -$>$
  • ;
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Define the scope resolution operator. In C++, this operator is used to access a global variable when there is a local variable with the same name, or to define a member function outside of its class definition.
Step 2: Identify the symbol. The symbol for the scope resolution operator is the double colon, ::. For example, if you have a global variable `x` and a local variable `x`, you can access the global one with `::x`. To define a class `MyClass`'s member function `myFunc`, you would write `void MyClass::myFunc()`.
Was this answer helpful?
0
0