Difference between Operator overloading and Functional
overloading?
Answer Posted / nsit@salem
C++ provides more than 35 operators, covering basic
arithmetic, bit manipulation, indirection, comparisons,
logical operations and others. Almost all operators can be
overloaded for user-defined types, with a few notable
exceptions such as member access (. and .*) as well as the
conditional operator. The rich set of overloadable operators
is central to using C++ as a domain-specific language. The
overloadable operators are also an essential part of many
advanced C++ programming techniques, such as smart pointers.
Overloading an operator does not change the precedence of
calculations involving the operator, nor does it change the
number of operands that the operator uses (any operand may
however be ignored by the operator, though it will be
evaluated prior to execution). Overloaded "&&" and "||"
operators lose their short-circuit evaluation property.
Operators that cannot be overloaded
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Difference between overloading vs. Overriding
What is difference between class and function?
When to use “const” reference arguments in a function?
What is the keyword auto for?
Is C++ case sensitive a) False b) Depends on implementation c) True
What are proxy objects in c++?
Explain virtual class and friend class.
What does the nocreate and noreplace flag ensure when they are used for opening a file?
What is difference between c++ 11 and c++ 14?
What is heap sort in c++?
Can we use this pointer inside static member function?
Explain how to initialize a const member data.
Why do we use the using declaration?
What is expression parser in c++
What does it mean to declare a member variable as static?