answersLogoWhite

0


Best Answer

in C++ there is no real difference as operators are overloaded by implementing them as functions. However, while we differentiate between function overloads by the function signature (the number and type of parameters), operator overloads are distinguished only by the parameter types. The parameters are interpreted as operands, and the number of operands will depend upon whether the operator is unary, binary or ternary. That is, for any given operator, the number of operands will be the same for each overload you implement. The only exceptions are the unary increment (++) and decrement (--) operators as they each have postfix and prefix variants. In order to differentiate their signatures, an unreferenced or dummy parameter must be passed to the postfix variants.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Distinguish between operator overloading and function overloading?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Difference between new operator and operator new?

new operator allows to allocate a memory from the heap..... so a new instance of a class is created.......... but operator new is used to overload the (new) operator........ juast like overloading of other operators


What is operator function?

An operator function implements a particular operator symbol. The database server provides special SQL-invoked functions, called operator functions, that implement operators. An operator function processes one to three arguments and returns a value. When an SQL statement contains an operator, the database server automatically invokes the associated operator function. The association between an operator and an operator function is called operator binding. You can overload an operator function to provide the operator for a UDT. The SQL user can then use the operator with the UDT as well as with the built-in data types. When an SQL statement contains an operator, the database server automatically invokes the associated operator function.


How can user defined operator overloading harm the readability of the program?

Because the built in operator has the precision and compiler knows all the precision between the operators, and it works on that precision. User can also create its own operator but the compiler does not come to know thow to make precision of this operator. Therefore we dont use user defined operator


Major c plus plus feature that were removed from java?

Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.Several features that they either made unsafe programs or hard-to-read programs were removed. Some of the features removed include operator overloading; pointers; implicit conversions between numeric and boolean; multiple inheritance.


What are the similarities between constructor overloading and function overloading?

The only similarity is that both constructor and function overloads are distinguished by their signature -- the number and type of their arguments. Functions differ in that they also have a return type, which is also part of the signature, whereas constructors have no return type, not even void.


difference between object and oriented program?

JAVA is an Object Based Programming Language. it doesn't provide multiple inheritance and operator overloading. while Object Oriented Lanuages provides both.


What is the distinguish between?

how can you distinguish between them


What are the differences between Java OOP and PHP OOP?

JAVA is an Object Based Programming Language. it doesn't provide multiple inheritance and operator overloading. while Object Oriented Lanuages provides both.


What is the difference between over-loading and over-riding in cpp?

Overloading and overriding do similar things but they are distinct. When you override a function, you are providing a new implementation of a function that was inherited from a base class. The signature of an override must be covariant with the base class signature. Overloading means to create several functions with the same name within the same namespace but with different signatures.


What is the function of an operator in biology?

Input output management Data management Security management Death lock Memory management


Distinguish between accounting and book keeping?

distinguish between book keeping and accounting


Define and distinguish between entries on the books and entries on the workpapers and explain why such an entries on the books and on the workpapers are required in the consolidation process?

what is distinguish between bookkeeping and accounting? what is distinguish between bookkeeping and accounting? what is distinguish between bookkeeping and accounting?