Monday 26 April 2021

Function Parameter Matching and Overloading Qus - 9

 #include<iostream.h>

#include<conio.h>

void show(char a)

{

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

}

void show(float a)

{

cout<<"float - "<<a<<endl;

}

int main()

{

clrscr();

show('k');

//show(5);      //ambiguity

//show(6.5);    //ambiguity

show((float)6.5);

getch();

return 0;


}

No comments:

Post a Comment