Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Saving/Restoring from a binary file of an unknowen sized object?

Options
  • 14-06-2001 2:54am
    #1
    Registered Users Posts: 7,314 ✭✭✭


    i'm design'n an instant messenger atm and anyway one of my issues is that i can't save/restore the user list properly of all users in the server...the userlist is a linked list so creating a single object for resoring from size don't seem to be working too well the program is crash'n when it tries to use the userlist after restore anyone help as to a way of saving/restoring linked list in C++ without damage to it?


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    My C++ skills are patchy at best. Are you just loading the data straight up out of a file are or you creating a new linked-list and populating it with the data from the file?


  • Closed Accounts Posts: 82 ✭✭NinjaBart


    That does sound like it could be the problem.

    Actually, I don't see how you could dump out an entire linked list reliably, because it's (probably) not guaranteed to be in one block of memory.

    Best idea would be to do with Evil Phil suggested and create a new linked list from the separate structs/classes you read in from the binary file. Or, perhaps that's what you're doing? Perhaps you should post some code smile.gif


  • Registered Users Posts: 7,314 ✭✭✭Nietzschean


    i've created a new linked list n want to populate it from the binary file...i'll post the code later...have to run.....if i am to restore them seperately how do i know how many there is?


Advertisement