Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!goanna!minyos.xx.rmit.oz.au!s892992 From: s892992@minyos.xx.rmit.oz.au (Bossman) Newsgroups: comp.lang.c++ Subject: Re: Calling Parent functions in Child??? Message-ID: <1991May15.044458.21518@minyos.xx.rmit.oz.au> Date: 15 May 91 04:44:58 GMT References: <91132.113932ACPS2924@Ryerson.Ca> Organization: RMIT Computer Centre, Melbourne Australia. Lines: 29 ACPS2924@Ryerson.Ca writes: >If one has the following situation : >class A { int isEqual{}; } >class B : public A { int isEqual{} } >B::isEqual() >{ > return (... && // here i want to call the parents isEqual > // how do i do it?? >} Inside the isEqual member function of B, a call to isEqual will result in a recursive call back to the same member funcion. To call A's version of isEqual, you need to use scope resolution. You can do this as follows: B::isEqual() { return (... && A:isEqual() ); } Simple huh! In fact the call to B's isEqual() member function can be structured the same way (ie: B::isEqual() ), but it is implicit that you are calling B's member functions from within a member of B. See ya, Kendall Bennett.