Professional Documents
Culture Documents
Function Overloading
Function Overloading
OVERLOADING
Need
Functon Overloading
void main() {
int s, l, b; foat radius; cin>>s>>radius>>l>>b; area(s); area(radius);
area(l, b); }
Calling overloaded
functon
• For calling overloaded functon
compiler goes through the process of
argument matching. A match can be
exact match or it can be through
promoton.
char c; void print(char);
Print(c);
char c; void Exact Exact
print(double); match match Print(c);
Match through
Match through promoton promoton
Restrictons on overloaded
functons
• Signature must be diferent with
same return type and same name of
the functon.