title: Can a non-const pointer modify a const var int c++?
body: <p>Here is my test code:</p>
  
  <pre><code>#define print(A) cout &lt;&lt; #A &lt;&lt;  " = " &lt;&lt; A &lt;&lt;  endl;
  int main()
  {
      const int e = 2;
      int *p = (int *)&amp;e;
      *p = 4;
  
      print(e);
      print(*p);
      print(&amp;e);
      print(p);
  }
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>e = 2;
  *p = 4;
  &amp;e = 0xbfc6b458;
  p = 0xbfc6b458;
  </code></pre>
  
  <p>Since "p" points to "e" according to their identical address, how can *p and "e" be different??? This can be dangerous, right?</p>