I am overloading a function it just prints the value which it received as an argument . Here is the code
#include<iostream>
using namespace std;
void show(int c)
{
cout<<"Int C : "<<c<<endl;
}
void show(char c)
{
cout<<"char C : "<<c<<endl;
}
void show(float c)
{
cout<<"Float C : "<<c<<endl;
}
void show(string c)
{
cout<<"String C : "<<c<<endl;
}
void show(const char* c)
{
cout<<"char *C : "<<c<<endl;
}
main()
{
string s("Vector");
show(25);
show('Z');
show("C++");
show("Hello");
show(4.9f);
show(s);
}
Here show(65) calls the integer function.
Is there any possibility that I can simply call show(65) to print the ASCII equivalent value 'A' i.e calling show(char) without calling show(int)