title: C/C++ changing the value of a const
body: <p>I had an article, but I lost it.  It showed and described a couple of C/C++ tricks that people should be careful. One of them interested me but now that I am trying to replicate it I'm not being able to put it to compile.</p>
  
  <p>The concept was that it is possible to change by accident the value of a <code>const</code> in C/C++</p>
  
  <p>It was something like this:</p>
  
  <pre><code>const int a = 3;          // I promise I won't change a
  const int *ptr_to_a = &amp;a; // I still promise I won't change a
  int *ptr;
  ptr = ptr_to_a;
  
  (*ptr) = 5;               // I'm a liar; a is now 5
  </code></pre>
  
  <p>I wanted to show this to a friend but now I'm missing a step.  Does anyone know what's missing for it to start compiling and working?</p>
  
  <p>ATM I'm getting <strong>invalid conversion from 'const int*' to 'int*'</strong> but when I read the article I tried and it worked great.</p>