Pointers and Function Overloading
Pointers and Function Overloading
float c,d;
cout <<”Enter the two float numbers “ ;
cin >> c>>d;
cout <<”before swapping “ ;
cout <<”c= “<< c;
cout <<”d= “<< d;
cout <<”after swapping “ ;
swap(c , d );
char e,f;
cout <<”Enter the two characters“ ;
cin >> e>>f;
cout <<”before swapping “ ;
cout <<”e= “<< e;
cout <<”f= “<< f;
cout <<”after swapping “ ;
swap(e , f );
}
void swap ( char a , char b)
{
char t;
t=a;
a=b;
b=t;
cout <<”a= “<< a;
cout <<”b= “<< b;
float c,d,c2;
cout <<”Enter the two float numbers “ ;
cin >> c>>d;
cout <<”c= “<< c;
cout <<”d= “<< d;
c2=sum(c , d );
cout <<”\n c2= “<< c2;
}
int sum ( int a ,int b)
{
int t;
t=a+b;
return t;
}