Which of the following operators below allow to define the member functions of a class outside the class?

  1. ::

  2. ?

  3. :?

  4. %


Correct Option: A

AI Explanation

To answer this question, you need to understand how member functions of a class are defined.

Option A) :: (Scope resolution operator) - This option is correct because it allows you to define the member functions of a class outside the class. The scope resolution operator is used to define functions outside the class scope.

Option B) ? (Ternary conditional operator) - This option is incorrect because the ternary conditional operator is used for conditional expressions and does not have any relation to defining member functions outside the class.

Option C) :? - This option is incorrect because it does not represent a valid operator in C++.

Option D) % (Modulus operator) - This option is incorrect because the modulus operator is used for calculating the remainder of a division operation and does not have any relation to defining member functions outside the class.

The correct answer is A) :: (Scope resolution operator). This option is correct because it allows you to define the member functions of a class outside the class scope.

Find more quizzes: