I'm not sure if its ok to ask a non SFML question here (the "read before posting" didn't say), if it isn't please tell me (so I learn) and I will delete it myself.
I finished my SFML test game (a snake clone), it was a fun and enjoyable experience. But I have a small problem I would like help with.
After installing the game, I can only save my game score if I run the game as admin mode. It reads it fine, but doesn't write.
- I created the install files using installshield on visual studio 2015.
- I create the file using ofstream
- the file is created in the install folder (install folder: C:\Program Files (x86)\Lkc)
- I'm using windows 10.
- Can't write to file even if the file already exists.
- Its a .dat file.
- it works fine on the visual studio, not sure if because it runs in admin mode, or because its saved at my docs.
Whats the best way to solve this problem?
Should I try grant the file permission to write? (To be honest after googling it for hours, I have no clue how to do that).
Should I save the file in some other place? Where would it be best/usual? (After googling it, no success using "CreateDirectory", can't give it a path and no example online worked for me, they're too old I think)
If anyone cal help I would really appreciate it.
Thank you for the time you took to read this.