Ok, i understand the need to make a pointer to the pointer so you can
make the pointer point to some other pointer (ok, so i intentionally
put lots of pointers in that line :) ) but here's what i'm trying to do:
Note: 'line' is defined as follows:
-- Part of parser.h --
typedef struct line_t line;
struct line_t {
char data[80];
line *next;
};
-- Start of actual source --
#include <stdio.h>
#include <string.h>
#include "parser.h" /* an external header contining structure definitions */
void next_1 (line **in);
void next_1 (line **in)
{
/* this is where i am having difficulties, gcc gives this error:
passback.c:9: request for member `next' in something not a structure
or union */
*in = in->next;
}
void main (void)
{
line *listy;
listy = (line *) malloc (sizeof (line));
strcpy (listy->data, "Hello");
listy->next = (line *) malloc (sizeof (line));
strcpy (listy->next->data, "Out There");
listy->next->next = NULL;
}
-- End --
anybody recommend a good Linux/unix C book? one that covers linux/unix related
things like processes etc. I DO have the Linux programming man reference
pages, however if you don't know the name of the function you're after, it's
a bit hard to find what you need :) (some sort of contents page would have
been useful)
-[[EMAIL PROTECTED]]-------------------------------------------------
Http://x-map.home.ml.org Mailto : [EMAIL PROTECTED]
---[Quote Of The Day]----------------------------------------------------------
-------------------------------------------------------------------------------