title: forbiddens in string literals in C
body: <p>In the K&amp;R book page 104, I came across this statement:</p>
  
  <blockquote>
  <pre><code>char amessage[] = "now is the time"; //an array
  char *pmessage = "now is the time";  //a pointer
  </code></pre>
    
    <p>Individual characters within the array may be changed but <code>amessage</code>
    will always refer to the same storage. The <code>pmessage</code> pointer may
    subsequently be modified to point elsewhere, but the result is
    undefined if you try to modify the string contents...</p>
  </blockquote>
  
  <p>So, would this be the error they meant in both cases?</p>
  
  <p>For the array,</p>
  
  <pre><code>amessage[] = "allocate to another address"; //wrong?
  </code></pre>
  
  <p>For the pointer,</p>
  
  <pre><code>pmessage[0] = 'n'; //wrong?
  </code></pre>
  
  <p>I just want to know when one is going against these rules.</p>
  
  <p>Thanks.</p>