1. How would I store the data pure EXE file in my C++ program? I know if I have the memory I can just dump it into a new file.
If you're under Windows, you can store the executable as a binary resource inside the larger executable, and then extract it as needed.
2. I have a few string constants at the start of my EXE (#defines in the original c++ code). Can I edit these on the programs copy of the EXE file before writing the data to disk? I know I could make a seperate file containing the constants and have the generated EXE read these in, but I'd rather it was created with the data embedded.
Maybe yes, maybe no. In any case, the new string contents will probably have to be the same size as the old one, or you'll likely break everything. In general, this is not good design. What's wrong with a resource file? Clearly if the strings are capable of changing they aren't meant to be constants.
I understand the concept in the first point (for a self-contained installer, for instance) but the second point doesn't make sense to me. If this is for localization, there are better solutions than hammering in different text inside the executable. But I don't know.
The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.
- Pessimal Algorithms and Simplexity Analysis