About linked lists

From: Kras Kresh (kras_kresh@hotmail.com)
Date: 04/04/01


I'm not sure about how the character lists and object lists are
created and linked.. I want to create list of descriptions and
numbers.

struct tmp {
  int x;
  struct tmp *next;
};

struct tmp *list;

int main() {
  struct tmp *n;
  CREATE(n, struct tmp, 1);
  n->x = 14;
  n->next = NULL;
  list = n;
  CREATE(n, struct tmp, 1);
  n->x = 3;
  n->next = NULL;
  list->next = n;
}

Would that work? I learned link list in C++ and its uses the new
operator so I have no idea about in C cept that here it doesn't
use the new operator. If something is wrong with the code I just
made up please help me fix it so I can use it. And what is that 1
in CREATE for?
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST