Function overloading is a feature of programming language where we can define function with same name.
For example,
int add(int a, int b)
{
return a + b;
}
double add(double a, double b)
{
return a + b;
}
add(1, 2); // calls to int add;
add(1.4, 3.2); // calls to double add;For function overloading to work 1) each function has to be differentiated from another by some means 2) and call to an overloaded function should resolve to a function. Otherwise, a compilation error would occur.
Overload Resolution
Overload resolution is a process where compiler links function call to the right function definition based on the argument types.