Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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

  • 14-06-2001 02:54AM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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