| function-overloading/overloading-1.cc - Exact matches - a trivial example. | Lecture 2 - slide 31 : 46 Program 1 |
#include <iostream>
#include <string>
using namespace std;
void f(long int i){
cout << "f(long int)" << endl;
}
void f(short int i){
cout << "f(short int)" << endl;
}
int main(){
long int a = 5;
f(a); // exact match: f(long ing)
short int b = 5;
f(b); // exact match: f(short int)
}