Hi,Am writing an application which requires storing data to a map and saving it to a file.How do i save a STL map to a file and retrieve it without the application crashing?

Recommended Answers

All 2 Replies

Tell me how much time did you spent on a search engine to find your answer.
In technical terms, 'saving' is known as serialization[1]
There are plenty of libraries out there to serialize STL containers. You are fortunate enough that Boost's Serialization Library is there on your demand.
Another library is provided on CodeProject

But I would suggest you to use this tool and find the best library for you, yourself.

[1] serialization is actually the process of converting an object into a sequence of bits so that it can be persisted on a storage medium (such as a file, or a memory buffer) or transmitted across a network connection link.

commented: Boost = red -1
commented: Counter red. Not ALL boost is crap +20
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.