Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!lll-winken!uunet!mcsun!hp4nl!utrcu1!infnews!skow From: skow@cs.utwente.nl (Jacek Skowronek) Newsgroups: comp.lang.c++ Subject: HELP: invoking derived methods Message-ID: <1991Jun5.090220@cs.utwente.nl> Date: 5 Jun 91 07:02:20 GMT Sender: skow@cs (Jacek Skowronek) Organization: University of Twente, Dept. of Computer Science Lines: 51 Originator: skow@utis52 I need help in such question: Let's say we have a class like this: class MyBaseClass { private: int data1; public: MyBaseClass(); MyBaseClass(const int the_data); void setData(const int the_data); }; and a class derived from MyBaseClass: class MyDerivedClass : public MyBaseClass { private: int data2; public: MyDerivedClass(); MyDerivedClass(const int the_data1, const int the_data2); void setData(const int the_data1, const int the_data2); }; Now: can the implementation of function setData look like that: void MyDerivedClass::setData(const int the_data1, const int the_data2) : (the_data1) { data2 = the_data2; } I have also such question: what function will be invoked by the call to MyDerivedClass::setData(d1,d2) ? Will it be so that first a function MyBasClass:setData(d1) will be invoked, according to the implementation ? Or maybe : (the_data1) notation applies only to constructors ? Thanks in advance, Jacek Skowronek -- ------------------------------------------------------------------- Jacek Skowronek e-mail: