Hmm, are you working in Windows? Windows has several easy way of doing it, but in the mean time be thinking of the variables you want to save. If you are interested in MFC check out the CFile class at MSDN. If not, there has to be an API to create files but I don't know what it is right off hand.
Don't forget that its not all about saving, it's also about loading.
If you are doing a console app, you could also just save out the data using an fstream. Save it out using a format that you design, and then you can read it back in assuming it is in the same format. It is pretty easy since fstreams have basically the same usage as cin and cout.
I'd suggest making a class if you don't already have one that holds the data. Then just write save and load functions that use an ofstream and an ifstream respectively. If you ever change your format, or add new data, you don't have to change your main code, only the save and load functions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.