Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!sdd.hp.com!spool.mu.edu!uwm.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!ml27192 From: ml27192@uxa.cso.uiuc.edu (lanett mark) Newsgroups: comp.sys.mac.programmer Subject: Re: C++ method overriding Message-ID: <1991Feb25.214458.11837@ux1.cso.uiuc.edu> Date: 25 Feb 91 21:44:58 GMT References: <2831@krafla.rhi.hi.is> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 22 aries@rhi.hi.is (Mimir Reynisson) writes: [stuff deleted] >Now in the above example someClass::someClass() doesn't call >someSubClass::getSomeID(). No thank you very much, it calls >someClass:getSomeID() - which is plain silly. >I presume I'll have to say this->getSomeID() to get the >right method, right??? >Can anybody confirm this correct? Or I'm just being a dum doik? Constructors always call functions of their own class, even if the functions are virtual and overloaded. For that matter, since constructors should be inittializing info, it's not necessarily such a good idea to have them calling other functions. Just create a new constructor for the subclass and you'll be set. -- //----------------------------------------------------------------------------- Mark Lanett ml27192@uxa.cs.uiuc.edu Quote of the Day: "I switched from a Sun 2/3 to a Mac Plus to get some speed"