What is the meaning of function overloading.
Answers
Answered by
0
Function overloading (also method overloading) is a programming concept that allows programmers todefine two or more functions with the same name and in the same scope. Each function has a unique signature (or header), which is derived from:function/procedure name. number of arguments. arguments' type.
Bhoomicharu:
to whom
Answered by
0
Functions having the same name but different arguments is termed as “function overloading”.
Explanation:
For example you want to add some values, sometimes you want to add two values, sometimes three values, then you can opt for function overloading.
void sum(int x, int y)
{
printf(“%d”, x + y);
}
void sum(int x, int y, int z)
{
printf(“%d”, x + y + z);
}
You can differ by number of argument or same number of argument with different type.
Similar questions
English,
7 months ago
English,
7 months ago
Social Sciences,
7 months ago
Computer Science,
1 year ago
English,
1 year ago