Re: Linked List of characters

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 05/03/98


On Sun, 3 May 1998, John Evans wrote:

->        if (!my_list) {
->          my_list->ch = ch;
->          my_list->num = 1;
->          my_list->next = my_list;
->        }

Here's your problem.  If !my_list means my_list == NULL (0x0).  You
can't do NULL->ch.  What are you trying to do here?  If it's an
attempt to initialize my_list, then do:

  CREATE(my_list, struct list_struct, 1);
  my_list->ch = ch;
  my_list->num = 1;
  my_list->next = NULL;

And it will (or should) work.

-dak


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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