Function Overloading in c++

Overloading ?

If we create two or more members having the same name but different in number or type of parameter, it is known as C++ overloading. In C++, we can overload:


function Overloading :

When the compiler is unable to decide which function is to be invoked among the overloaded function, this situation is known as function overloading.
Function overloading is a C++ programming feature that allows us to have more than one function having same name but different parameter list, when I say parameter list, it means the data type and sequence of the parameters,Read More..


Function Overloading is defined as the process of having two or more function with the same name, but different in parameters is known as function overloading in C++.
In function overloading, the function is redefined by using either different types of arguments or a different number of arguments. It is only through these differences compiler can differentiate between the functions.Read More..

sum(int num1, int num2)
   sum(int num1, int num2, int num3)
   sum(int num1, double num2)

Example 1:

Output :

	35
	191

Example 2:



Output :

r1 is : 42
r2 is : 0.6