Multiple choice general knowledge science & technology

The member functions of a class can be defined outside the class using

  1. Extraction Operator

  2. Insertion Operator

  3. Questionmark Colon operator

  4. Scope resolution operator

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The scope resolution operator (::) connects a member function definition to its class when defined outside. You write ReturnType ClassName::functionName(parameters) to show this function belongs to ClassName. The extraction (>>), insertion (<<), and ternary (? :) operators serve completely different purposes in C++.