[prog] new and delete operator...

Kathryn Hogg kjh at flyballdogs.com
Fri Jul 13 15:44:52 UTC 2007

sena emre wrote:
> Hi everyone,
>   thanks for the comments, I tried to print some values but could not
> solve the problem..
>   lately I tried what Tim suggested but I could not see a great
> differecnce between the codes...
>   more I not sure how to use delete operator to free some space hold by
> the new operator...

If you allocate memory with new you must release it with delete.  If
allocate memory with new [somesize] then you must release it with delete

>   Is the delete[] command works for every type of data structure like
> struct, class...etc.

It doesn't matter what type it is as long as you properly match up
new/delete and new[]/delete[].


More information about the Programming mailing list