Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Initializing a Member That is a Class Message-ID: <583@taumet.com> Date: 4 Feb 91 21:12:37 GMT References: <1991Jan31.194631.3447@persoft.com> <580@taumet.com> Distribution: na Organization: Taumetric Corporation, San Diego Lines: 23 steve@taumet.com (Stephen Clamage) writes (I wrote): >Given > class A { public: A(int, int, int); }; > class B { A a; B(int, int, int); }; >you would write, for example: > B::B(int i, int j, int k) : A(i, j, k) { ... } >This is the same way you pass arguements to base class constructors. OOPS. I meant to say B::B(int i, int j, int k) : a(i, j, k) If A were a base class of B, you could invoke its constructor as A(i, j, k), using the name of the class. For a data member, you use the name of the member, not its type, in the header. -- Steve Clamage, TauMetric Corp, steve@taumet.com