One problem is that you cannot assign strings across the equals sign in C. (Yeah, I know: "WTF???" but it is what it is)
You are working in a language with absolutely no awareness of text or strings. Instead it uses character arrays and adds a null to the end of each "string". The only way to move strings around is to copy them with library functions... strcpy(), strdup() etc.
For example:
Code:
newPtr->symbol = string; /*place string in node*/
... simply is not going to work.
What you end up doing is assigning your symbol pointer to the address of string... and if you are getting your input into a standard buffer, you will end up with ALL your strings pointing to the same place... thus displaying whatever text was last placed in the buffer.
You can try this...
Code:
// plan A
newPtr->symbol = strdup(string);
// plan B (if you don't have strdup)
newPtr->symbol = malloc(strlen(string) + 1);
strcpy(newPtr->symbol,string);
In either of these cases you will eventually have to free() the memory allocated to these strings... *before* you destroy the node struct.