if you included a text file with your program could you acess it for read/write?
Printable View
if you included a text file with your program could you acess it for read/write?
I don't know how you could compile a text file in your .exe without the compiler giving errors, but if you mean include in in a zip file or something, you can try fstream, found in fstream.h.
i know:D
(donīt hurt me for that)
you can add a text file to the end of your exe so that the exe could read the text. but you have to know the exact size of it and start reading from the end of the compiled code. anyway windows donīt take care of additional data at the end of an exe, so it is still executable.
for some reasons you cannot modify it during runtime
;)
You should be able to add the file as a user defined resource.....
Then use FindResource() to get a handle on it.......load it into memory with LoadResource()......lock it with LockResource() ......this then gives you a handle to the resource contents......then use WriteFile() to dump the data into a file.......