c++ - Reading Linked List from txt file (comma separated) -


i wondering what's best way read linked list text file?

i've got write file system working, i'm unsure of how can "reverse" such , populate linked list?

he's current write file code:

void linkedlist::writefile() {     ofstream myfile;     node* thisnode = head;     myfile.open("example.txt");          {         myfile << thisnode->shape<< ",";         myfile << thisnode->colour << ",";         myfile << thisnode->size << ",";         myfile << thisnode->type << ",";         myfile << thisnode->volume << ",";         myfile << thisnode->density << ",";         myfile << thisnode->capacity << ",";         myfile << "\n";         thisnode = thisnode->nextnode;     } while (thisnode != null);      myfile.close(); } 

i'm open suggestions! :)

thanks.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -