Ok thanks guys reviewed my program forgot to declare the fuctions at the top
But I'm still getting this error
[Warning] assignment from incompatible pointer type
in all my functions where i search the next node.
Code:node * curr=top; while (curr->next!=NULL){ printf(" The word ' %s ' occurs %d times\n\n", curr-> word, curr-> count); curr=curr->next;
the error message is for thelineCode:curr=curr->next
Can someone please explain this error for me. I'd like to know why i get this error message
btw thanks for the all the help.
Well, it would help if you post your recent reviewed code.
Anyway, my guess is that the error is because curr->next is of type struct next* while curr is of struct node* type.Code:typedef struct node{ char word[50]; int count; struct next *next; } node;
For a linked list you need a "self-referential" structure which means probably you need to change the "next" in red above to "node".
Not everything that can be counted counts, and not everything that counts can be counted
- Albert Einstein.
No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
- Herbert Mayer
Ah yes, that's the problem there you're right. Thanks alot it really helped. My struct declaration was wrong.
Ok well all that is done but my program still doesn't compile i now get this error message
Can some one explain what i am doing wrong there[Linker error] undefined reference to `printList'
[Linker error] undefined reference to `searchList'
[Linker error] undefined reference to `insertWord'
ld returned 1 exit status
[Linker error] undefined reference to `findPrevious'
I am almost done with this prograam once i get this to work the program will most certianly compile successfully.
btw I've made all the changes that you guys recommended earlier