delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/17/04:45:39

From: "Rafał Maj" <r_maj AT poczta DOT onet DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: deleting NULL ?
Date: Sun, 17 Sep 2000 10:08:13 +0200
Organization: Academic Computer Center CYFRONET AGH
Lines: 21
Message-ID: <8q1u4s$jh3$1@info.cyf-kr.edu.pl>
NNTP-Posting-Host: d-94-53-20.cyfronet.krakow.pl
X-Trace: info.cyf-kr.edu.pl 969178076 20003 149.156.1.180 (17 Sep 2000 08:07:56 GMT)
X-Complaints-To: news AT cyf-kr DOT edu DOT pl
NNTP-Posting-Date: 17 Sep 2000 08:07:56 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,
what is supposed to happen when I'll try delete NULL:
int* x = NULL;
delete x;
Should I every time write   if (x) delete x;    ?

And what about :
int* x=NULL;
delete []x;

What will happen when I'll use my class, witch have destructor ?
myclass* x=NULL;
delete x;
delete []x;

Will all above examples work same for other compilers then DJGPP ?

Thanks, Rafal



- Raw text -


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