View Single Post
  #2   Spotlight this post!  
Unread 03-11-2003, 22:13
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Well, there's no way to just do something like
saveAllVariables()
loadAllVariables()

but you can just write them all out to a file one by one:

ofstream ofs;
ofs.open("out.txt", ios:ut);
if(!ofs){
//error stuff goes here
}

ofs << var1 << ' ' << var2 << ' ' << var3 << etc, etc;

ofs.close();

and then to read it back in:

ifstream ifs("out.txt");
if(!ifs)
//error stuff

ifs >> var1 >> var2 >> var3 >> etc,etc;



Let me know if you need anything else.

-Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php