The idea of overloading is so that the same name for more than one function in a class. Here is an example. PHP: void Display(const char *theText) const;void Display(const aRequest &theRequest) const;void Display(cont float theNumber) const; Once defined you can call them PHP: myExternalInterface.Display("Some text");myExternalInterface.Display(theRequest);myExternalInterface.Display(1.5);
In addition to rrosario's excellent example, in laymans terms it allows a function to take an argument of various types or an argument of many parameters and varied types. Take for instance if you had a function called EditContact(). You could invoke it in the following ways (given they are properly defined): EditContact() //no argument might prompt for everything EditContact(int phone) EditContact(string name) EditContact(int phone, string name) All the above functions have the same name, but are different because they take different arguments. So using the above as reference: EditContact(5555555555) would call 2 from above. EditContact(5555555555, "Billy Mays") would call 4 from above. ...and etc. Overloading is done behind the scene and the compiler knows which one to use. ~UAT Student