From: sparhawk AT eunet DOT at (Gerhard Gruber) Newsgroups: comp.os.msdos.djgpp Subject: Re: "delete" and "delete []" operators Date: Thu, 09 Jul 1998 19:54:04 GMT Organization: Customer of EUnet Austria Lines: 29 Message-ID: <35ac1dc6.18799942@news.Austria.EU.net> References: <873ecbeyni DOT fsf AT hasn DOT dera DOT gov DOT uk> NNTP-Posting-Host: e016.dynamic.vienna.at.eu.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Destination: Ian Miller From: Gruber Gerhard Group: comp.os.msdos.djgpp Date: 09 Jul 1998 18:12:49 +0100: >> If I create an array like this: >> >> typedef char *cptr; >> cptr x; >> x = new char[15]; >> >> Should I then, when I come to free the memory, use: >> >> delete x; >> or >> delete [] x; > >delete [] x; Why? If have seen this delete[] in a few cases but I don't really know what the difference is to the "normal" delete. -- Bye, Gerhard email: sparhawk AT eunet DOT at g DOT gruber AT sis DOT co DOT at Spelling corrections are appreciated.