# include
using namespace std;
The class zerotwo
{
Public:
Zerotwo ()
{
I=1;
}
Zerotwo operator * (zerotwo& Right)
{
Zerotwo temp.
Temp. I=I * right. I;
return temp;
}
Zerotwo operator=(zerotwo& Right)
{
I=right. I;
}
int i;
};
Int main ()
{
Zerotwo p1.
Zerotwo p2.
P1=p * (p2); "-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
wrong here}
CodePudding user response:
Parameters such as const T&Opertor=return references rather than values
Use return * this;
CodePudding user response: