S
Steve
OK, this is the first time I've used structs. I'm trying to create a linked
list.
Obviously most of it is missing but I'm trying to get it to compile
error-free with the struct and functions defined. Why do I get the error
"parse error before '*' token" 5 times (once for each use of list_node*)?
==================================
struct list_node {
char content[10];
struct list_node *next;
};
/* Creates a new list and returns a pointer to the first node */
list_node* create_list(void) {
return 0;
}
/* Copies a string into a new node and adds to the list in alphabetical
order. Returns int success value */
int insert(list_node*, char*) {
return 0;
}
/* Removes the first occurrence of the string parameter. Returns int success
value */
int remove(list_node*, char*) {
return 0;
}
/* Prints the list of string from first to last */
void print(list_node*) {
return;
}
/* Destroys the list, deallocates all associtaed memory. Returns int success
value */
int destroy_list(list_node*) {
return 1;
}
int main()
{
}
list.
Obviously most of it is missing but I'm trying to get it to compile
error-free with the struct and functions defined. Why do I get the error
"parse error before '*' token" 5 times (once for each use of list_node*)?
==================================
struct list_node {
char content[10];
struct list_node *next;
};
/* Creates a new list and returns a pointer to the first node */
list_node* create_list(void) {
return 0;
}
/* Copies a string into a new node and adds to the list in alphabetical
order. Returns int success value */
int insert(list_node*, char*) {
return 0;
}
/* Removes the first occurrence of the string parameter. Returns int success
value */
int remove(list_node*, char*) {
return 0;
}
/* Prints the list of string from first to last */
void print(list_node*) {
return;
}
/* Destroys the list, deallocates all associtaed memory. Returns int success
value */
int destroy_list(list_node*) {
return 1;
}
int main()
{
}