User Profile

Collapse

Profile Sidebar

Collapse
Salin
Salin
Last Activity: Dec 19 '09, 05:48 PM
Joined: Dec 15 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Salin
    replied to How to write std::list into a file?
    in C
    OK, I get it now. If there's no way to write list directly into file, I have to write its elements separately, one by one. I did so and it works, when I have to read the list from the file, I just create new objects, give them data from file and create a new list of them. Just thought that there was simpler way.
    Thank you.
    See more | Go to post

    Leave a comment:


  • Salin
    replied to How to write std::list into a file?
    in C
    Do you mean that I should manually write out the content of my objects in the list? I know how to do it, but I just want to save the entire list in one command. Is it possible?
    See more | Go to post

    Leave a comment:


  • Salin
    started a topic How to write std::list into a file?
    in C

    How to write std::list into a file?

    Hello. I'm a newbie in C++ file management. I've got a std::list of pointers to objects of my own class (std::list<MyCl ass*>;). Inside my class, there are some strings, ints and methods. I need to save this list into a file, but I don't know how. I've tried fwrite() and WriteFile(), but no results. Could anyone tell me how to save this list into a file? And if I have to use one of these functions, how do I take memory size of my list?
    See more | Go to post
No activity results to display
Show More
Working...