 <p>One way to accomplish this is to put all your strings into a header file, and name them:</p> <pre><code>// StringHeader.h #define helloWorld "Hello World" #define error_invalid_input "Error: Invalid Input" #define this_could_get_tedious "this could get tedious" </code></pre> <p>Then you can use those strings:</p> <pre><code>#include "StringHeader.h" std::cout &lt;&lt; this_could_get_tedious &lt;&lt; std::endl; </code></pre> <p>Then you can run a program on your <code>StringHeader.h</code> to hash each string, and generate a replacement header file:</p> <pre><code>// Generated StringHeader.h #define helloWorld 097148937421 #define error_invalid_input 014782672317 #define this_could_get_tedious 894792738384 </code></pre> <p>That looks very manual and tedious, at first, but there's ways to automate it.</p> <p>For example, you could write something to parse your source code, looking for "quoted strings". Then it could name each string, write it to a single <code>StringHeader.h</code>, and replace the inline quoted string with the new named string constant. As an additional step when you create the file, you could hash each string - or you could has the file in one go after you've created it. This could let you create a hashed and non-hashed version of the file (which could be nice to create a non-hashed Debug version, and a hashed Release version).</p> <p>If you do try that, your initial parser to look for strings will have to handle edge cases (comments, #include lines, duplicated strings, etc).</p>