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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!bellahs!jjamison
  3. From: jjamison@bellahs.com (John Jamison RD AC)
  4. Subject: Re: Is Ctor X() required for the object of class X to be able to be dynamically allocated?
  5. Message-ID: <1992Nov19.191043.18010@bellahs.com>
  6. Summary:  Yes
  7. Keywords: constructor X(), dynamic allocation
  8. Organization: Bell Atlantic Healthcare Systems
  9. References: <BxxC3p.Btn@math.uwaterloo.ca>
  10. Date: Thu, 19 Nov 1992 19:10:43 GMT
  11. Lines: 18
  12.  
  13. In article <BxxC3p.Btn@math.uwaterloo.ca> xjzhu@math.uwaterloo.ca (Xiaojun Zhu) writes:
  14. >Q: Is it necessary to have a constructor which took no argument in order
  15. >   for the object of a class to be able to be dynamically allocated?
  16. >
  17. >More specifically,  I have a class X, when I can say
  18. >
  19. >X *x=new X[10] ?
  20. >
  21. >Is it required that class X have a constructor X()?
  22. >
  23. I can't cite chapter and verse, but such a constructor is required to
  24. create arrays of objects.
  25.  
  26. -- 
  27. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  28. \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  29. John Jamison
  30. Bell Atlantic Healthcare Systems
  31.