NNTP-Posting-Host: 172.16.26.200 Newsgroups: comp.os.msdos.djgpp Date: Wed, 25 Aug 1999 14:31:45 +0200 Message-ID: <0E16861EE7BCD111BE9400805FE6841F0B1B54D7@c1s5x001.cor.srvfarm.origin-it.com> From: bas DOT hamstraNOSPAM AT nl DOT origin-it DOT com (Bas Hamstra) Subject: Re: About memory allocation References: <37C19A5C DOT 51C150AF AT cartsys DOT com> X-Newsreader: Forte Free Agent 1.0.82 Lines: 27 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Nate Eldredge wrote: >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. Is the memory also freed when your program exits with exit(n) ? Regards, Bas Hamstra.