The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+6 votes

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

  1. .(member Access or Dot operator)
  2. ?: (ternary or Conditional Operator)
  3. :: ( Scope Resolution Operator)
  4. All of the above
asked in Object Oriented Programming by Boss (34.1k points) | 2.3k views

3 Answers

+6 votes

All ternary operators can't be overloaded so ans is option D.

answered by
edited by
+6 votes

Operators which cannot be overloaded[edit]

  • ?: (conditional)
  • . (member selection)
  • .* (member selection with pointer-to-member)
  • :: (scope resolution)
  • sizeof (object size information)
  • typeid (object type information)


Ans: D

answered by Loyal (7.1k points)
+1 vote

List of operators that cannot be overloaded

1. Scope resolution operator   (::)   
2. Pointer-to-member Operator (.*)   
3. Member Access or Dot operator  (.)   
4. Ternary or Conditional Operator  (?:)
5. Object size Operator   (sizeof)
6. Object type Operator   (typeid)

option D

answered by Loyal (8.5k points)

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

36,132 questions
43,577 answers
42,815 users