Which of the following operator(s) cannot be overloaded?
2017
Which of the following operator(s) cannot be overloaded?
- A.
. (Member Access or Dot operator)
- B.
?: (Ternary or Conditional Operator )
- C.
:: (Scope Resolution Operator)
- 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.