Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!ukma!kminor From: kminor@ms.uky.edu (Kevin R. Minor) Newsgroups: comp.lang.c Subject: arrays of linked list help Message-ID: <14680@s.ms.uky.edu> Date: 24 Mar 90 04:50:26 GMT Reply-To: kminor@ms.uky.edu (Kevin R. Minor) Organization: U of Kentucky, Mathematical Sciences Lines: 40 I have a question about arrays of linked lists. I am working on a program that must access data very quickly, and this method looks like the best to me in terms of saving memory, and keeping speed quick. Here's an example of my structure. struct node { . . . struct node *next }; Now, I define the following array struct node *list [LISTSIZE]; Now, here's my questions: How do I access an element of this list? Do I do list [i] -> stuff, or must I use parentheses, and if so, where? How do I send one element of this list to a function? I am trying, for instance, to insert some data into my list. Let's say I want to insert into list [3] My function declaration is insert (struct node *list, int data) I call the function insert (list [i], 32); I know that the function doesn't return anything, but I'm not interested in that now. I mainly need to know how to access individual elements in the list. Thanks in advance. Kevin (kminor@ms.uky.edu) -- I want to be the disc jockey at WWV