Monday 26 April 2021

Function Parameter Matching and Overloading Qus - 5

 #include<iostream.h>

#include<conio.h>

void show(int a)

{

cout<<"int - "<<a<<endl;

}

void show(char a)

{

cout<<"char - "<<a<<endl;

}

int main()

{

clrscr();

show(5);     //Exact Match

show('k');  //Exact

//show(6.7);  //coversion   - Ambiguity

//show();      //No Match - Error

getch();

return 0;


}

No comments:

Post a Comment