C++ examples for Function:Function Overload
Writing Two Versions of a Function with overloading function
#include <iostream> #include <string> using namespace std; void printName(string first, string second){ cout << first << " " << second << endl; } void printName(int first, int second){ int sum = first + second; cout << first << " " << second << " " << sum << endl; } int main(){/* w ww.j av a 2s . c om*/ printName("A","B"); printName(15,20); return 0; }