delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/11/02:27:02

X-Apparently-From: <amitvikas AT yahoo DOT com>
Message-ID: <39BC7BD7.6A19D043@yahoo.com>
Date: Mon, 11 Sep 2000 11:59:43 +0530
From: Vikas <amitvikas AT yahoo DOT com>
Organization: programmingParadise
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: 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

Can't you do it like this:
	char *x=new char[255];
	free(x);
Will it work?
I though it is the same meaning whether you use malloc or 'new', and the
same meaning whether you free it or delete it. These should result in
the same OS API, regardless of the language you use. 
I have been deleting a strdup() from long time. That all was a waste!!!

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019