Linked list question

From: Hades (tourach@servtech.com)
Date: 04/19/96


Ok, I have the struct:

struct linked_list_data {
  int junk;
  struct linked_list_data *next;
};

struct blah_data {
  int blah;
  char *nothing;
  struct linked_list_data *list;
};

Say I do this:
struct blah_data *blahstuff;

And blahstuff gets some info in it, and blahstuff->list becomes a linked
list. If I free(blahstuff) what happens to the list? Will it free the entire
list or does it just leave it there in memory?

could I do this?

newblahstuff->list = blahstuff->list;
free(blahstuff);

And would newblahstuff have the old linked list from blahstuff even though
blahstuff has been freed?

I'm having a hell of a time with olc, freeing mob prototypes, and keeping
the linked lists attached to the protos intact.

ANy help appreiciated.



This archive was generated by hypermail 2b30 : 12/18/00 PST