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.
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( )
Last edited by The Brain; 02-28-2005 at 01:52 PM.
- "Problem Solving C++, The Object of Programming" -Walter Savitch
- "Data Structures and Other Objects using C++" -Walter Savitch
- "Assembly Language for Intel-Based Computers" -Kip Irvine
- "Programming Windows, 5th edition" -Charles Petzold
- "Visual C++ MFC Programming by Example" -John E. Swanke
- "Network Programming Windows" -Jones/Ohlund
- "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
- "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel
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.
Hope is the first step on the road to disappointment.