home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16522 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.2 KB  |  33 lines

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