40 likes | 239 Views
Object as function Argument & Object returning object. Object as function Argument. Like other data type , an object can be used as function argument. The copy of the object is passed to the function Class A { in x,y ; Public: Void check( A ); }; Void A :: check( A s){
E N D
Object as function Argument Like other data type , an object can be used as function argument. The copy of the object is passed to the function Class A { in x,y; Public: Void check( A); }; Void A :: check( A s){ x=s.x;y=s.y; } Void main() { A obj1,obj2; obj1.check(obj2); }
Object as function Argument & Object returning object Question Addition of two complex nos 3x +i 5 2x +i 2 --------- 5x +i 7