POV-Ray : Newsgroups : povray.off-topic : c++ memory question : Re: c++ memory question Server Time
11 Oct 2024 17:47:20 EDT (-0400)
  Re: c++ memory question  
From: Samuel Benge
Date: 2 Oct 2007 19:17:08
Message: <4702d174$1@news.povray.org>
Warp wrote:
>   Odd question, given that you answered it even before you asked it.

I knew I'd get this response from someone. I was just worried about the 
non-new declaration of arrays and variables, but I am clear on those now.

>   If you deleted it, you would have more deletes than news, which would
> break the "for each new, delete" rule.

Indeed. This happened with my maze game, and I got a warning about it.

>> I didn't use a "new" flag to initialize the [static] array. Is the 
>> memory used by that array freed after the program is terminated?
> 
>   No. It's freed when it goes out of scope.

Cool. Thanks!

Sam


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.