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

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 (35.1k points) | 2.4k views

3 Answers

+6 votes

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

http://www.geeksforgeeks.org/g-fact-14/

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)

ref: https://en.wikibooks.org/wiki/C%2B%2B_Programming/Operators/Operator_Overloading

Ans: D

answered by Loyal (7.6k 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 (9.7k points)
Answer:

Related questions



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

44,265 questions
49,758 answers
164,200 comments
65,849 users