Again Problem With teh Same Point Class
Code Pasted Here http://phpfi.com/246031
BEFORE I usedBut I noticed thatCode:pt2 = pt1;//Works fine
Its not calling the overloaded 'Operator='
So I made it
On line 44 But Although Its Calling the Overloaded 'Operator='Code:*pt1 -= *pt2;
{As its printing "I am Getting Executed" on the line}
This is the 'Operator=' function
On line 20-22Code:Point* Point::operator=(const Point& pt){ cout<<"I am Getting Executed"<<endl; return this;//datatype Of this is Point* Const }
Please help.
--------------------------------------------------------------------
here is the Output of this Programm
--------------------------------------------------------------------
Code:Describing Class : pt1 x = 15 y = 10 Describing Class : pt2 before Copying x = 4 y = 8 I am Getting Executed Describing Class : pt2 after Copying x = 4 y = 8 destructing Describing Class : pt2 after Increamenting x = 9 y = 13 destructing Describing Class : pt1 after Decrementing x = 6 y = -3



LinkBack URL
About LinkBacks



