search
Log In
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
7 votes
3k 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
in Object Oriented Programming 3k views

3 Answers

9 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

6 votes

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

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


edited by
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

Answer:

Related questions

1 vote
1 answer
1
430 views
Which of the following operators cannot be overloaded in C++? * += == : :
asked Jul 25, 2016 in Object Oriented Programming jothee 430 views
5 votes
3 answers
2
2.9k views
Which of the following is associated with objects? State Behavior Identity All of the above
asked May 7, 2017 in Object Oriented Programming sh!va 2.9k views
5 votes
2 answers
3
3.1k views
Which of the following UML 2.0 diagrams capture behavioral aspects of a system? Use case diagram, Object diagram, Activity diagram and state machine diagram Use case diagram, Activity diagram and state machine diagram Object diagram, Communication Diagram, Timing diagram and Interaction diagram Object diagram, Composite structure diagram, package diagram and Deployment diagram
asked May 7, 2017 in Object Oriented Programming sh!va 3.1k views
5 votes
4 answers
4
3.2k views
We use malloc and calloc for: Dynamic memory allocation Static memory allocation Both dynamic memory allocation and static memory allocation None of these
asked May 7, 2017 in Programming sh!va 3.2k views
...