[prog] new and delete operator...

Akkana Peck akkana at shallowsky.com
Thu Jul 12 17:36:19 UTC 2007

sena emre writes:
> well, the program shuts down before completing some tasks due to unsufficient memory...
>   the value of my.sco is between 10-50, it varies...but I did not check the value of the 
>   "new " operator... I have not check a value like this before....

Are you sure that the delete [] call is actually being called? Maybe
the program isn't getting to that point, so the memory isn't being
deleted when you think it is. It might help to put couts/printfs
where memory is being allocated and deallocated, to make sure.

For more detailed memory information, try the valgrind program.
It can give you all sorts of great information about memory usage
in your program. It looks intimidating at first but it's actually
pretty well documented and easy to use.

    "Beginning GIMP: From Novice to Professional": http://gimpbook.com

More information about the Programming mailing list