What is function overloading and operator overloading?

Showing Answers 1 - 1 of 1 Answers

samiksc

  • Jan 25th, 2006
 

Function overloading refers to having two or more methods in the same scope which have the same name but different signature. (Note that a function signature includes name of the function, ordered list of parameter data types. It DOES NOT include the return type and the names of parameters.) For example a class implementing geometrical functions may have several overloaded versions of 'CalculateArea()' function.

Operator overloading refers to writing a different implementation for existing operators. For example a class implementing logic for complex numbers may provide an overloaded version of '+' operator which will add two complex numbers.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions