Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!gryphon!sarima From: sarima@gryphon.COM (Stan Friesen) Newsgroups: comp.lang.c++ Subject: Re: Calling super methods Message-ID: <18793@gryphon.COM> Date: 13 Aug 89 16:50:43 GMT References: <26200002@zaphod> Reply-To: sarima@gryphon.COM (Stan Friesen) Organization: Trailing Edge Technology, Redondo Beach, CA Lines: 23 In article <26200002@zaphod> doug@zaphod.prime.com writes: > >This is either a dumb question or a complaint. If one has a derived class >then it is not uncommon to want to combine methods with a parent class. > > [rest of example deleted] > >int derived::op() >{ > j++; > // I want to call base::op here. Do I have to explicitly > // call: > base::op(); > // ?? >} > Yes, either that or the following: base(*this).op(); // Cast the object to its parent class -- Sarima Cardolandion sarima@gryphon.CTS.COM aka Stanley Friesen rutgers!marque!gryphon!sarima Sherman Oaks, CA