can someone point me in the direction of a good tutorial for reading a file and taking the data from the file and placing that into a linked list. or some suggestions. thanks.
Printable View
can someone point me in the direction of a good tutorial for reading a file and taking the data from the file and placing that into a linked list. or some suggestions. thanks.
This is what I would do:
1) Read the file in word-by-word using a loop to infile >> into a temp string.
2) Assign the temp string into a node: new node->item = temp;
3) Repeat the process until eof( )
You mean a direction like the FAQ? I know for a fact that the topics of reading from files, and Linked Lists are both in there.
Quzah.