file i/o -linked list
I am trying to insert data from a file into a struct and then a singly linked list. The file has 9 rows of data per entry and 10 entries. Each entry contains 5 char rows, 1 double and 3 ints. I am missing something here, the printed list skips over several rows and only contains 2 of the 10 entries. I believe the problem lies in the struct portion of the code. Please give me some insight and direction. I've attached the file since it is to big to post here.
The >> operator will leave a '\n' in the input buffer, so everytime you use it before getline you'll have to remove the '\n'. Your file read should be something like this -
inFile >> temp.price;
inFile >> temp.copyrightDate;
inFile >> temp.quantity;
inFile >> temp.status;
readInv(&head, temp);//call function to fill linked-lists
zen, I cannot thank you enough! It worked like a charm and that's a beautiful thing. Again, thanks so much, you are number one in my book, thanks and thanks.