Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!zaphod.mps.ohio-state.edu!wuarchive!news.uu.net!bywater!arnor!watson!blinn.watson.ibm.com!mittle From: mittle@blinn.watson.ibm.com (Josh Mittleman) Newsgroups: comp.lang.c++ Subject: Re: Derived/Base Class constructor relationship Message-ID: <1991May22.153541.24133@watson.ibm.com> Date: 22 May 91 15:35:41 GMT References: <29534@hydra.gatech.EDU> Sender: @watson.ibm.com Distribution: na Organization: IBM T. J. Watson Research Lines: 31 In article <29534@hydra.gatech.EDU>, gt5595c@prism.gatech.EDU (BARTZ) writes: > class A > { > A(int f1,int f2,double first ...); // Constructor of base class > ... > }; > > class B : public A > { > B(int g1,double first ...) : Matrix(g1,g1,first) {}; > // Constructor for derived class > ... > }; I assume that instead of "Matrix" you meant "A". Ellipsis is not an argument, it is a compiler directive. It means that the compler may match a call with any number of trailing arguments with this function declaration. In particular, it is *not* a list of values. When you write A(g1, g1, first), all you are passing is the single value, first. The only way to access the additional values which may follow first is to use the va_list macros, or some similar method. These only work within the function which has the ellipsis signature. I have been able to pass a pointer to the list of values to second function by initializing a va_list in the calling function, and then passing a reference to it. In the recipient function, va_arg works just fine with this reference. =========================================================================== Josh Mittleman (mittle@watson.ibm.com or joshua@paul.rutgers.edu) J2-C28 T.J. Watson Research Center, PO Box 704, Yorktown Heights, NY 10598