overloading the unary plus operator using member function
overloading the unary plus operator
is as shown below
<header files>
class A
{
int x;
public:
A(int=0);
A operator +();
};
A A :: operator +()
{
return
A(+x);
}
No comments:
Post a Comment