home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!utcsri!skule.ecf!torn!watserv2.uwaterloo.ca!watmath!xjzhu
- From: xjzhu@math.uwaterloo.ca (Xiaojun Zhu)
- Subject: Is Ctor X() required for the object of class X to be able to be dynamically allocated?
- Message-ID: <BxxC3p.Btn@math.uwaterloo.ca>
- Keywords: constructor X(), dynamic allocation
- Organization: University of Waterloo
- Date: Wed, 18 Nov 1992 18:16:36 GMT
- Lines: 22
-
- Q: Is it necessary to have a constructor which took no argument in order
- for the object of a class to be able to be dynamically allocated?
-
- More specifically, I have a class X, when I can say
-
- X *x=new X[10] ?
-
- Is it required that class X have a constructor X()?
-
- I had some experience with TC++(V1.00) which seems that X() is
- required. Anybody has any experience? Why or why not such a ctor
- is needed?
-
- Pointer to where I may find the answer is also appreciated.
- (I have ARM, C++PL(2nd Ed.) and Lippman's C++ Primer(1st Ed.))
-
- --------------------------------------------------------------
- A template version of signature class is under repair.
- Symptom: I can't seem to be able to dynamically allocate it.
-
- xjzhu@math.uwaterloo.ca
- --------------------------------------------------------------
-