Thursday, March 18, 2010

What is operator overloading with an example.

In computer programming, operator overloading (less commonly known as operator ad-hoc polymorphism) is a specific case of polymorphism in which some or all of operators like +, =, or == have different implementations depending on the types of their arguments. Sometimes the overloadings are defined by the language; sometimes the programmer can implement support for new types.

Operator overloading is useful because it allows the developer to program using notation closer to the target domain and allows user types to look like types built into the language. It can easily be emulated using function calls;

This is a very useful link if you need what are the operators that can be overloaded.

http://www.csharphelp.com/2006/03/c-operator-overloading/

No comments:

Post a Comment