Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. How do I save/load STL data (map & vector)

How do I save/load STL data (map & vector)

Scheduled Pinned Locked Moved ATL / WTL / STL
c++questiongraphicstutorial
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Larry Mills Sr
    wrote on last edited by
    #1

    Can someone show me how to send (save/Write) and receive (load/Read) data contained in a map and/or vector. class CData{ public: string one, two, three; CData() {}; ~CData() {} }; the map is declared as: map DATA; How do I read/write it's data to a file ("MyMapFile.dat") ??? vector vecDATA; how do I read/write it's data to a file("MyVecDATA.dat") ??? I'm new to the STL and would need explicit examples that are known to work properly PLEASE. C++ is my favorite programming language

    A C 2 Replies Last reply
    0
    • L Larry Mills Sr

      Can someone show me how to send (save/Write) and receive (load/Read) data contained in a map and/or vector. class CData{ public: string one, two, three; CData() {}; ~CData() {} }; the map is declared as: map DATA; How do I read/write it's data to a file ("MyMapFile.dat") ??? vector vecDATA; how do I read/write it's data to a file("MyVecDATA.dat") ??? I'm new to the STL and would need explicit examples that are known to work properly PLEASE. C++ is my favorite programming language

      A Offline
      A Offline
      Alexandru Savescu
      wrote on last edited by
      #2

      You cannot automatically serialize STL objects to files. You must write your own file format. If you use only MFC then you can use CArray and CMap as containers and serialize with CArchive. Regards, Alexandru Savescu

      1 Reply Last reply
      0
      • L Larry Mills Sr

        Can someone show me how to send (save/Write) and receive (load/Read) data contained in a map and/or vector. class CData{ public: string one, two, three; CData() {}; ~CData() {} }; the map is declared as: map DATA; How do I read/write it's data to a file ("MyMapFile.dat") ??? vector vecDATA; how do I read/write it's data to a file("MyVecDATA.dat") ??? I'm new to the STL and would need explicit examples that are known to work properly PLEASE. C++ is my favorite programming language

        C Offline
        C Offline
        CP Visitor
        wrote on last edited by
        #3

        http://www.parashift.com/c++-faq-lite/serialization.html[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups