POV-Ray : Newsgroups : povray.off-topic : c++ memory question : c++ memory question Server Time
11 Oct 2024 11:11:31 EDT (-0400)
  c++ memory question  
From: Samuel Benge
Date: 2 Oct 2007 18:45:30
Message: <4702ca0a@news.povray.org>
Hi,

It's probably a stupid question, but here goes. I know that for every 
"new", there must be a delete. I don't deal with malloc statements, so 
let's disregard that branch of memory management.

So here's the question. 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? I didn't use a "new" flag to initialize the array. Is the 
memory used by that array freed after the program is terminated?

I can't find information regarding this, as all the texts I found dealt 
with the "new" and "delete []" statements.

I ask this because my Light's Out game seem to use more and more memory 
each time it is run and closed, but the memory consumption actually goes 
back down to what it originally was after the 11th or 12th time. I don't 
get why that would happen...

Sam


Post a reply to this message

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