Program of UNARY operator overloading using friend function

/*Program of UNARY operator overloading using friend function*/

#include
#include
class A
{
int a,b;
public:
void getdata(int p,int q)
{
a=p;
b=q;
}
void display()
{
cout<<"\na="<OUTPUT :

a=2
b=3
After operator overloading
a=-2
b=-3

ga('create', 'UA-52099617-1', 'auto'); ga('send', 'pageview');







Leave a Reply

Your email address will not be published. Required fields are marked *