home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / next / programm / 8346 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.1 KB

  1. Path: sparky!uunet!munnari.oz.au!sgiblab!spool.mu.edu!uwm.edu!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!scsing.switch.ch!sicsun!disuns2!ricci
  2. From: ricci@disuns2.epfl.ch (Nicolas Ricci)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Array deletion with ObjC++
  5. Message-ID: <5715@disuns1.epfl.ch>
  6. Date: 27 Jan 93 10:20:16 GMT
  7. Reply-To: ricci@disuns2.epfl.ch (Nicolas Ricci)
  8. Organization: Ecole Polytechnique Federale de Lausanne
  9. Lines: 34
  10.  
  11.  
  12. Does anybody know how to delete an array in ObjC++ (NeXTStep 3.0) ?
  13.  
  14. The standard way for doing that is to use the form
  15.     delete [] _cast_expression_
  16.  
  17. for example :
  18.  
  19.     int* a = new int[10];
  20.     ...
  21.     delete [] a;
  22.  
  23. When I compile this code with the ObjC++ Compiler, I get the following
  24. error message :
  25.  
  26.     parse error before ']'
  27.  
  28. To solve this problem, I tried to give as parameter the size of the array
  29. to delete, like this :
  30.  
  31.     delete [10] a;
  32.  
  33. In this case, I just got the warning (but NO error message !):
  34.  
  35.     array size expression for delete ignored
  36.  
  37. With this non ANSI-C++ syntax, could I be sure that my array will be
  38. correctly deleted ?
  39.  
  40. Thanks for help.
  41.  
  42.  
  43.  
  44. Nicolas Ricci
  45. e-mail : ricci@disuns1.epfl.ch
  46.