Is there a way to embed .txt files (their text) into a binary C++ program executable?
(EDIT: answered by the top comment)
What I mean by that, is, I want compile some .txt files into a single executable (.exe), so I don't need to depend on said files on the front end. Therefore, I only need to distribute a single .exe file and put it in any directory without the hassle of having to move a whole folder and making sure the executable is either ran from the command line or has to be in the root of a folder.
I search the web but couldn't find anything reasonable, that wouldn't take a lot of code and time.
Hope I made my question clear, thank you in advance for answers and opinions!
.exeI assume you're on Windows? Then you could create a resource file to embed arbitrary text as resource that are linked into your executable program. This is very standard for Windows applications, but generally not used for larger files, or files that needs to be updated independently of the executable file (which is generally a good idea).winapiRelated: https://stackoverflow.com/questions/2933295/embed-text-file-in-a-resource-in-a-native-windows-application