In: Computer Science
What does it mean to overload a function? What are the requirements? Give an example of 2 overloaded functions.
To overload, a function means having 2 or more functions with the same name and these functions have different tasks to perform.
The requirements to overload a function are :
Example :
int sum (int a, int b,int c)
{
return (a+b+c);
}
int sum (int a, int b)
{
return (a+b);
}
int sum (float a, float b,float c)
{
return (a+b+c);
}