title: How to instruct VC++ compiler to not inline a constant?
body: <p>I have the following global constant in my C++ program:</p>
  
  <pre><code>const int K = 123456 ;
  </code></pre>
  
  <p>When I compile the program, the resulting executable contains the literal value <code>123456</code> in all the places where the value is used (dozens of times).</p>
  
  <p>But, if I remove the <code>const</code> qualifier, the value <code>123456</code> appears only once in the entire executable (in the <code>.data</code> section).<br>
  This is the result I'm looking for. I want the value <code>123456</code> to appear only once so that it can be changed simply by editing the .exe file with a HEX editor.</p>
  
  <p>However, I don't want to remove the <code>const</code> qualifier because I want the compiler to prevent me from accidentally modifying the constant in the source code.</p>
  
  <p>Is it possible to instruct the compiler somehow to not inline the value of said constant?</p>
  
  <hr>
  
  <p>The reason I need to do this is so that the executable is easily modifiable by students who will be tasked with "cracking" an example program to alter its behavior. The exercise must be simple enough for inexperienced people.</p>