title: Why is this C-string assignment illegal?
body: <p>CASE 1: <code>char s[][6]={"Hello","world"};</code> 
  in this case, a static array is allocated in read-only memory and from there the elements are copied to the array.
  and in case 2.</p>
  
  <p>CASE 2: <code>char* s= "hello world";</code> will place it in read-only memory.</p>
  
  <p>so my question is why </p>
  
  <pre><code>char s[][6]={"Hello","world"};
  s[1]="lucky"; //is illegal
  </code></pre>
  
  <p>because if elements are being copied from read-only memory then why this statement <code>s[1]="lucky";</code> can't be copied from read-only memory to array because an array is also allocated for this string literal and from there, elements are copied to s[1].
  I have read many answers, and all are telling what's the difference but no one tells why? please explain as I am a beginner.</p>