save feature in RPGs

Started by
2 comments, last by Chris F 24 years, 5 months ago
a very simple way to do that would be to have a struct such as

struct GameData
{
// game data in here...
};

// .. standard header files
#include <fstream>
using namespace std;

int main()
{
// ....
GameData gamedata;
ofstream FILE_OUTPUT;

//...
FILE_OUTPUT.write( "game.dat", &gamedata, sizeof(gamedata) );
//...

if i remember correctly that is the syntax, but it might be a little different..

so just mess with that... it should work

if anyone has corrections , feel free to post them

-zerovoid

[This message has been edited by zerovoid (edited November 16, 1999).]

Advertisement
well depending on what you want to save that should work
Can anyone help mus we are making an RPG but we dont know how to make a save feature. Any help would be very much appreciated.
"I have realised that maths can explain everything. How it can is unimportant, I want to know why." -Me
Thanks!!!!

This topic is closed to new replies.

Advertisement