www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/17/18:15:14

From: "Rafał Maj" <r_maj AT poczta DOT onet DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: void* conversions & delete
Date: Mon, 18 Sep 2000 00:00:14 +0200
Organization: Academic Computer Center CYFRONET AGH
Lines: 15
Message-ID: <8q3f52$1bc$1@info.cyf-kr.edu.pl>
NNTP-Posting-Host: d-94-53-17.cyfronet.krakow.pl
X-Trace: info.cyf-kr.edu.pl 969228258 1388 149.156.1.177 (17 Sep 2000 22:04:18 GMT)
X-Complaints-To: news AT cyf-kr DOT edu DOT pl
NNTP-Posting-Date: 17 Sep 2000 22:04:18 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,
is this code correct :

int *pos = new int[2];
void* var = (void*)pos;
delete []((int*)var);

I'm not sure, will everything be o.k. when I'll temporarly store adress of
int[] array    in    void*
If this example has bug, how to fix it ?

Thanks,
Rafal


- Raw text -


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