Overloading Functions

C++ allows multiple functions to have the same name:

void PrintMe (string s) { cout << "string s = \"" << s << "\"" << endl ; } void PrintMe (int i) { cout << "int i = " << i << endl ; } void PrintMe (string s, int i) { cout << s << " " << i << endl ; }



Function Signature





Resolving Overloaded Functions

When a function call involves an overloaded name, the compiler must determine which function to call.





Details of Rule 2





Errors in Resolving Overloaded Functions





const and &





Details of Resolving Overloaded Functions






Default Arguments