I'm trying to write a text based game using C. To do this the way I want, I need to include a save system that will output all of the necessary variable values to external files, then be able to load the values fro those files later. Any advice?
Nicholas_1
0
Newbie Poster
Recommended Answers
Jump to PostWhat kind of variables? Are we talking just scalar values or data structures? The former are easy to export, but the latter could take a little thinking to get a format that's easy to both export and subsequently import.
Jump to PostAny flat file format will work then. CSV is a common one, and if you're not going to have embedded commans in your values, the format is both simple and easy to parse.
Jump to PostLet's step back a moment. How well do you know C? Granted I didn't provide details, but what I said should be enough to get you started unless you're a total beginner with no clue how to read and write files or about basic string manipulation.
All 11 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Nicholas_1
0
Newbie Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Nicholas_1
0
Newbie Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
Nicholas_1
0
Newbie Poster
linux
107
Posting Shark
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Nicholas_1
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Nicholas_1
0
Newbie Poster
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.