delorie.com/archives/browse.cgi | search |
Message-ID: | <39BCF300.B2260BBD@softhome.net> |
Date: | Mon, 11 Sep 2000 16:58:08 +0200 |
From: | Laurynas Biveinis <lauras AT softhome DOT net> |
X-Mailer: | Mozilla 4.75 [en] (Win98; U) |
X-Accept-Language: | lt,en |
MIME-Version: | 1.0 |
To: | djgpp AT delorie DOT com |
Subject: | Re: strdup() with delete[] |
References: | <8pgtns$sja$1 AT info DOT cyf-kr DOT edu DOT pl> <20000911010800 DOT C23829 AT chance DOT cz> |
Reply-To: | djgpp AT delorie DOT com |
Egon Eckert wrote: > > Err, I did quote your text wrong in my previous reply. So, once again. :) > > > All memory allocated like > > char* s = new char[100]; > > should be deleted using : > > delete s[]; > > right ? > > I guess the [] form is considered obsolete. I would use simple delete s. It isn't obsolete. delete [] is the only way to delete new'ed arrays. It is covered in comp.lang.c++ FAQ. Laurynas
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |