1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. Which statement about operator overloading in C++ is…

Added 30 Nov -0001

Which statement about operator overloading in C++ is correct?

  1. The precedence of an operator can be redefined
  2. Overloaded operators are resolved at run time
  3. At least one operand must be a user-defined type Correct answer
  4. Any built-in operator may be given a fresh meaning

Correct answer

C. At least one operand must be a user-defined type

13 views

MCQSEXAM

Explanation

An overloaded operator is only a function whose name is spelled with an operator keyword, and the language requires at least one operand to be a class or enumeration type so that the built-in types keep their meaning. Precedence, associativity and arity are fixed by the grammar and cannot be altered, and only existing operators may be overloaded. The choice of function is made at compile time by ordinary overload resolution.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C++ and Object-Oriented Programming MCQs

Practise all C++ and Object-Oriented Programming MCQs

Similar MCQs