title: C String manipulation pointer vs array notation
body: <p>Why does the first version make the program crash, while the second one doesn't? Aren't they the same thing?</p>
  
  <h2>Pointer Notation</h2>
  
  <pre><code>char *shift = "mondo";
  shift[3] = shift[2];
  </code></pre>
  
  <hr>
  
  <h2>Array Notation</h2>
  
  <pre><code>char shift[] = {'m', 'o', 'n', 'd', 'o', '\0'};
  shift[3] = shift[2];
  </code></pre>
  
  <hr>
  
  <h2>MWE</h2>
  
  <pre><code>int main( void )
  {
      char *shift = "mondo";
      shift[3] = shift[2];
  
      char shift[] = {'m', 'o', 'n', 'd', 'o', '\0'};
      shift[3] = shift[2];
  
      return 0;
  }
  </code></pre>