Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!isgate!krafla!aries From: aries@rhi.hi.is (Mimir Reynisson) Newsgroups: comp.sys.mac.programmer Subject: C++ method overriding Message-ID: <2831@krafla.rhi.hi.is> Date: 25 Feb 91 20:37:29 GMT Organization: University of Iceland Lines: 52 Ok, ok, I know Bjarne and his bunch don't want to call methods methods, but methinks methods are methods and should be slightly different than functions. Which brings me to the point. Consider the following example: class someClass : public HandleObject { public: someClass(void); short getSomeID(void); }; class someSubClass : public someClass { public: short getSomeID(void); }; someClass::someClass(void) { CreateSomething(getSomeID()); }; someClass:getSomeID(void) { return kSomething; }; someSubClass::getSomeID(void) { return kSomethingElse; }; 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? --MymR On the subject of disclaimers: Q: What do you call ten thousand dead lawyers at the bottom of the ocean? A: A good start...