what is the function of overloading
Answers
Overloading is defined as
Overheating of an electrical appliances due to the sudden flow of current through it . It may lead to electric fires
Function overloading: Overloading of the functions can be performed by defining the functions with same names but with different argument list within a class. The functions are overloaded to perform different functionality.
Explanation:
To overload the functions within a class, one should define the functions with the same name but the argument is different. So, that they can perform different tasks.
Syntax: -
//defining the class
public class ABC
{
//access modifier
public:
//function with no arguments
void fun1()
{
//code block
}
//function with arguments
void fun1(int x)
{
//code segment
}
//function with some different argument
void fun1(int y)
{
//code segment
}
}
Learn more:
Operator overloading:
https://brainly.in/question/641846
https://brainly.in/question/6086771