ok, so i create this file in the same directory as my exe for my game. how would i make a file, like if i wanted a file like "Player.dml" so people couldn't edit it? then i do:
ofstream save_file("Player.dml");
save_file<<player.health;
save_file<<"\n";
save_file<<player.name;
save_file.close();
//later when i open
char garbage[10];
ifstream open_file("Player.dml");
open_file>>player.health;
open_file>>garbage;
open_file>>player.name;
open_file.close();
//now i have all these variable values available?
does it work like that? please answer both questions