Which of the following operator(s) cannot be overloaded?

2017

Which of the following operator(s) cannot be overloaded?

  1. A.

    . (Member Access or Dot operator)

  2. B.

    ?: (Ternary or Conditional Operator )

  3. C.

    :: (Scope Resolution Operator)

  4. D.

    All of the above

Attempted by 160 students.

Show answer & explanation

Correct answer: D

In C++, specific operators are prohibited from being overloaded to preserve language semantics. The member access operator (.), the ternary conditional operator (?), and the scope resolution operator (::) are explicitly restricted. Therefore, if these operators are listed among choices, 'All of the above' is the correct answer.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro