Path: utzoo!attcan!uunet!comp.vuw.ac.nz!actrix!Bruce.Hoult From: Bruce.Hoult@actrix.co.nz (Bruce Hoult) Newsgroups: comp.lang.c++ Subject: Re: overloading operator+ Keywords: Overloading Message-ID: <1990Nov10.185303.2943@actrix.co.nz> Date: 10 Nov 90 18:53:03 GMT References: <1742@enuxha.eas.asu.edu> Organization: Actrix Public Access UNIX, Wellington, New Zealand Lines: 13 Comment-To: hocker@enuxha.eas.asu.edu >When compiling this program in TC++, I receive an errors concerning the >overloading of the operator+. I don't see why you need the struct type "p". Confusion between it and pclass is the root of your problem. Changing your operator+ function to pclass operator+ (pclass a, pclass b) { return pclass (a.pnt.X+b.pnt.X, a.pnt.Y+b.pnt.Y, a.pnt.Z+b.pnt.Z); } will fix the immediate problem, and make the program execute correctly.