I have to create a program that performs various functions with a linked list. I must save the functions in a separate file from the main() but then I can't figure out how to include the list in the header file. I tried different combinations and right now I have this in the linkedList.h file:
typedef struct list_elements* item;
And this in the linkedList.c
typedef struct list_elements{
int value;
struct list_elements *next;
}item
The problem is that when I try to compile the main.c I get the message: "request for member ‘value’ in something not a structure or union" and "request for member ‘next’ in something not a structure or union".
I looked on the suggested textbooks and online but I cannot find an explanation on how to use linked lists with header files?
(The functions work when I tested the whole thing in a single file, so I don't think they are the problem);