The process of linking of function call to function definition at compile time is called as Compile Time Polymorphism. It can be through Function and operator overloading.
Function overloading: The process of defining the function with same name but with different number or type of argument is known as Function Overloading. In function Overloading, the function would perform different operations depending on the argument list in the function call. The correct function to invoked is determined at compile time by checking the number and type of the arguments but not on the function return type.
Example:
Function Overloading:
Swapping of two integers and swapping of two float values.
// Function definition1- swapping two integers
void swap(int*p, int*q)
{
int t;
t=*p;
*p=*q;
*q=t;
}
// Function definition2- swapping two floats
void swap(float*p,float*q)
{
float t;
t=*p;
*p=*q;
*q=t;
}