Re: Question re: freeing structs [NEWBIE]

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 10/14/02


On Mon, 14 Oct 2002, Mathew Earle Reuther wrote:

> If I remove those, it no longer complains.  It is my understandng from
> this that simply by freeing the structure itself, the integers are
> freed?

You need only free what you allocate.  Another way of looking at this is
that one doesn't free pointers, but the memory that they point to.
(Consequently, you never call free() on something that's not a pointer,
and you only call free() on some pointers.)

-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT