Subj : Re: Need help, please! To : borland.public.cpp.borlandcpp From : "Bojidar Markov" Date : Wed Nov 26 2003 12:00 am Hi Ed, The whole task is: "Predefine the operator "-" using member function and friend function." That's all. I tried to implement it using those two functions, but I cant with the vectors. If you help me get this working, I promise I will leave you! :) (I already feel enough uncomfortable) I just want a working example. Thats all. Heres the code snipped: //------------------------------------------------------------------- //Global definition of the operator "-" which will be used later as friend function of the class ClassA: ClassA operator-(const ClassA Obj1, const ClassA Obj2) { ClassA tmp; tmp.iMember = Obj1.iMember - Obj2.iMember; return tmp; } class ClassA { public: int iMember; //Example for operator "-" as member function: ClassA operator-( const ClassA Obj ) const { ClassA tmp; tmp.iMember = iMember - Obj.iMember; return tmp; } //And as friend function of the class ClassA: friend ClassA operator-(const ClassA Obj1, const ClassA Obj2); } //Usage: ClassA OBJ1, OBJ2; OBJ1.iMember = 5; OBJ2.iMember = 3; int iRes = OBJ1 - OBJ2; // iRes==2 //------------------------------------------------------------------- I dont know how to return you the favour! Regards, Bojidar .