Path: utzoo!utgpu!watserv1!watmath!att!dptg!pegasus!hansen From: hansen@pegasus.ATT.COM (Tony L. Hansen) Newsgroups: comp.lang.c++ Subject: Re: delete [] Summary: delete [] array Message-ID: <4937@pegasus.ATT.COM> Date: 29 Jul 90 05:00:17 GMT References: <641@atcmpe.atcmp.nl> <1990Jul27.231220.8396@cerc.utexas.edu> Reply-To: hansen@pegasus.ATT.COM (Tony L. Hansen) Organization: AT&T Bell Labs Middletown/Lincroft NJ USA Lines: 21 < From: lynch@cerc.utexas.edu (Tom Lynch) < delete m; would be sufficient. delete [10] m is redundant Absolutely NOT! Without the [], C++ does not know that it's an array of objects to be deleted instead of a single object, and the destructors would not be called for elements 1..m of the array. < Stroustrup p 259: Your reference is outdated. Get Stroustrup's latest work, coauthored with Margaret Ellis, The Annotated C++ Reference Manual, a.k.a. E&S. < I don't know what delete [] m means. As I said, your reference is outdated. The latest C++ rules say that the number within the [] is unnecessary and the environment is required to keep track of how many elements are in the array. Tony Hansen att!pegasus!hansen, attmail!tony hansen@pegasus.att.com