title: Why do I get a compiler error, when applying the increment operator to a constant variable
body: <p>If I declare a constant variable</p>
  
  <pre><code>int const n=100; cout&lt;&lt;n+1&lt;&lt;endl;
  </code></pre>
  
  <p>The console shows the value as 101</p>
  
  <p>but when I write a code like this:</p>
  
  <pre><code>int const n=100;
  n++;
  cout&lt;&lt;n&lt;&lt;endl;
  </code></pre>
  
  <p>There is a <a href="http://coliru.stacked-crooked.com/a/baead5bb3acd64c2" rel="nofollow noreferrer">compile time error</a>:</p>
  
  <blockquote>
  <pre><code>main.cpp: In function 'int main()':
  main.cpp:6:5: error: increment of read-only variable 'n'
  </code></pre>
  </blockquote>
  
  <p>Is the second case different from the first case? </p>