i wanna be able to save certain variables in my program, like levels in a game for instance. the only way i can think of is to save the variables to a .txt file, then making the program "import" them later. is this possible if so, how?
also, am i thinking correctly for making a svae function?
just as you said.. simply write them into a txt file.. but please keep in mind that you'll need a delimiter or something like that, so that you can separate your information :)
if you're relatively new to coding and/or c++ you should start looking into the many uses of XML. I can't recommend a specific XML library but I'm sure someone here can. If you want to learn about XML syntax then go to w3schools.com and check out their XML section, it's pretty simple. XML is all text so it is fast and cross platform. There are libraries you can use that will easily enable you to read and write from and to XML and it sounds like that will fit your needs much better than a txt file. Not to mention if you are thinking about writing a game and you want to get good at it, XML is a step in the right direction.