when more than one function has the same name but different

  • Types of parameters.
  • OR Numbers of parameters.
  • OR Order of parameters.

then these function is said to be overloaded.

Note: Return type is not considered as overloading criteria. Two function with same name can have different return type.

Function overloading is a property of Compile time Polymorphism because binding of the function-call to the exact matching function is done during compile time only i.e which version of function should be called is decided during compile time.

Function Overloading Example in C++

Output of Program

Function Overloading in C++

Function overloading gives power to use multiple types or number of data under the same function name. If you have any problem then comment below.

Leave a Reply