Help with save-and-load text files

closed account (9jG6URfi)
Hi! I'm a new member to this forum :)
I recently started learning fstream in C++ and I have a question. How do you make it such that the user cannot edit or view the text file but the program can? Thanks!
closed account (9jG6URfi)
Anyone?
win32 api function SetFileAttributes()

with windows or

If you don't want to pull in the windows.h header, a more lightweight solution would be to use C run-time function _chmod() . To use that function, you need to #include <io.h> .

Side note you can never make it forever un-accessable by the user as most users probably wouldn't want a bunch of files on their own computer that they couldn't edit or delete...
closed account (9jG6URfi)
They're meant for game files, I don't mind the user deleting them, I just mind them editing the text files.
well editing is going to be unavoidable what you need to do is encrypt the data so that the user doesn't understand what they are looking at.
Topic archived. No new replies allowed.