+ 2

🔘 What is Function Overloading?

Explain..

30th Aug 2017, 5:53 AM
Amit Kr Raz
Amit Kr Raz - avatar
2 Respuestas
+ 2
writing a function with same name but differ in number or type of arguments or returning values is called overloading. overloading is useful in certain situations for example if you want to know educational details of a set of people and some of them just completed under graduation and some are post graduates then two functions with same name "qualification" with different number of arguments could be created like qualification(ug ){} and qualification (ug,pg ){} can be created. hope you got my point.
30th Aug 2017, 6:36 AM
Yagnavalk Chaapala
Yagnavalk Chaapala - avatar
+ 9
Specifying multiple defination of functions with same name (with different type and no of arguments ) for e.g: #include <iostream> using namespace std; class Print { public: void print(int a) { cout << a<< endl; } void print(double b) { cout << "Printing float: " << b << endl; } }; int main(void) { Print p; // Call print to print integer p.print(5); // Call print to print float p.print(500.263); return 0; }
30th Aug 2017, 6:13 AM
P R
P R - avatar