Help reading and writing to file
Hi, I am new with C++. I need to wriet a programme that saves some data in a file, and when it starts, it reads that data, and stores it in a LinkedList. I dont know how to read this data from the file and save it in a LinkedList. I had been thinking about separating each field with a ' ; ', but then it woub be very tedious to be checking for ' ; ' . Anybody got any ideas???
|
if file is text - you can read it line per line with fgets (man fgets). If file is binary - you can use fread. Make cycle, while there is not end of file - read some data and add it to linked list
|
All times are GMT -5. The time now is 03:16 AM. |