home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18471 < prev    next >
Encoding:
Text File  |  1992-12-28  |  1.3 KB  |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!geraldo.cc.utexas.edu!slcs.slb.com!aa.cad.slb.com!bl.cad.slb.com!nntpserver!shibuya
  3. From: shibuya@bl.applicon.slb.com (Hiroto Shibuya)
  4. Subject: Variable length array in C++
  5. Message-ID: <SHIBUYA.92Dec28120216@chute.bl.applicon.slb.com>
  6. Sender: usenet@mailhost.bl.cad.slb.com (USENET Administrator)
  7. Reply-To: shibuya@bl.applicon.slb.com
  8. Organization: Applicon; Billerica, MA (USA)
  9. Distribution: comp
  10. Date: Mon, 28 Dec 1992 17:02:16 GMT
  11. Lines: 23
  12.  
  13. Question from C minded programmer.
  14.  
  15. What is a simple way in C++ to implement variable length array - an
  16. array which grow in size as needed?  In C, I often use realloc to
  17. reallocate an array to bigger size, but in C++, there is no
  18. corresponding "renew" (?).  Do I have to revert to malloc and realloc?
  19. My understanding was that I never have to use malloc in C++.
  20.  
  21. Description of class "Blocks" in USL standard components sounds like
  22. what I need but I don't have access to that library.  So I appreciate
  23. if anybody could tell me what is the common technique in C++ to
  24. implement this kind of data type.  I just want to have simple array
  25. and do not want to make list out of it.  Thanks in advance.  
  26. --
  27.                     Hiroto Shibuya
  28.             
  29.                     Applicon Inc.
  30.                     Billerica, MA
  31.                     U.S.A.
  32.  
  33.  
  34.  
  35.  
  36.