-
-
Save Computer-Code-C/e28472e0f3db859343a014634a568abc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Match through integral promotion in Function overloading | |
#include<iostream> | |
using namespace std; | |
void f(int a) | |
{ | |
cout<<"Function 1 called"; | |
} | |
void f(long int a) | |
{ | |
cout<<"Function 2 called"; | |
} | |
int main() | |
{ | |
f('a'); // char type promoted to int | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment