#include <iostream>
using namespace std;
void f(int x);
void f(double x);
int main() {
int i = 1;
double d = 1.1;
short s = 9;
float r = 1.5F;
f(i); // calls f(int)
f(d); // calls f(double)
f(s); // calls f(int) -- type conversion
f(r); // calls f(double) -- type conversion
return 0;
}
void f(int x) {
cout << "Inside f(int): " << x << "\n";
}
void f(double x) {
cout << "Inside f(double): " << x << "\n";
}
|