POV-Ray : Newsgroups : povray.off-topic : c++ memory question : Re: c++ memory question Server Time
11 Oct 2024 11:12:40 EDT (-0400)
  Re: c++ memory question  
From: Fredrik Eriksson
Date: 2 Oct 2007 18:46:08
Message: <op.tzldjaptcs6ysw@e6600>
On Wed, 03 Oct 2007 00:36:05 +0200, Samuel Benge  
<stb### [at] THIShotmailcom> wrote:
> If I create an array like so: int i[20];, and then proceed to assign  
> values for each entry, must I then delete it at some point?

No. Indeed, you must not, as it is not dynamically allocated.


> Is the memory used by that array freed after the program is terminated?

It is freed when 'i' goes out of scope. If 'i' is in namespace scope, it  
goes out of scope when the program ends.



-- 
FE


Post a reply to this message

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