Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!cica!iuvax!rutgers!cmcl2!edith!edith.ultra.nyu.edu!andersnb From: andersnb@lab.nyu.edu (Brian Anderson) Newsgroups: comp.lang.c++ Subject: inheriting an object with a strange constructor... Message-ID: Date: 11 Dec 89 14:14:54 GMT Sender: news@edith.ultra.nyu.edu Distribution: comp Organization: Ultracomputer Laboratory, New York, New York. Lines: 41 Hi, I have an object that uses the va_arg facility to create an object that has an unknown size until runtime: class A { private: char* thing; public: A(int i...) { // create space for thing and // use va_arg to read in i arguments // placing them in thing } }; I must do it this way since the size of each argument is variable and I don't want to waste space using unions. This work fine. However, I now want to inherit this class into another class B. I there anyway to pass the variable number of arguments from class B's constructor to the constructor of A? For example (probably not valid C++ code): class B: A { public: B(int i...): A(i...) { // other stuff } }; Is there a better way to do this? Remember I am very concerned about space utilization, so an array of union types is not a good answer. -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Brian G. Anderson | NYU Ultracomputer Research Project ||| 715 Broadway Rm. 1006 ||||| New York, NY 10003 ||||| (212) 998-3346 --- //\ --- arpa: andersnb@cmcl2 ----/ \---- uucp: {ihnp4,seismo}!cmcl2!andersnb ---- ----