delorie.com/archives/browse.cgi | search |
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: | <ivglrCA7V$o1Ew74 AT lwithers DOT demon DOT co DOT uk> <873ecbeyni DOT fsf AT hasn DOT dera DOT gov DOT uk> |
NNTP-Posting-Host: | e016.dynamic.vienna.at.eu.net |
Mime-Version: | 1.0 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Destination: Ian Miller <itmiller AT dera DOT gov DOT uk> 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.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |