home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18188 < prev    next >
Encoding:
Text File  |  1992-12-21  |  699 b   |  25 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!uunet.ca!snitor!promis.com!fogel
  3. From: fogel@promis.com (Richard Fogel)
  4. Subject: Should char arrays be deleted with delete[]?
  5. Message-ID: <1992Dec18.161338.28124@promis.com>
  6. Keywords: C++
  7. Organization: PROMIS Systems Corp.
  8. Date: Fri, 18 Dec 1992 16:13:38 GMT
  9. Lines: 14
  10.  
  11. Should char strings allocated as follows:
  12.  
  13. char *str = new char[10];
  14.  
  15. later be deleted by:
  16.  
  17. delete []str   OR    delete str  ?
  18.  
  19. ------------------------------------------------------------------------------
  20. Thanks, this would be a great help, as the texts do not realy address this
  21. issue, and I understand that the wrong delete approach will cause unexplained
  22. results.
  23.  
  24. Richard Fogel
  25.