www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/23/17:22:00

Sender: nate AT cartsys DOT com
Message-ID: <37C19A5C.51C150AF@cartsys.com>
Date: Mon, 23 Aug 1999 12:00:44 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.12pre4 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: About memory allocation
References: <Fvdw3.325$Os5 DOT 51835 AT wagner DOT videotron DOT net>
Reply-To: djgpp AT delorie DOT com

OmniMeta wrote:
> 
> My question is :
> if i do this :
> 
> int *p;
> int main()
> {
>     p = new int;
>     return 0;
> }
> 
> Here I didn't use the delete operator to free p
> Did p will be automaticaly deleted with the end of the program, or did p
> will stay in memory until i reboot ?

When your program exits, all memory allocated by `malloc' or `new' is
freed.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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