title: Static C string allocation question
body: <p>Consider the following code:</p>
  
  <pre><code>char* str = "Hello World";
  memcpy(str, "Copy\0", 5);
  </code></pre>
  
  <p>A segmentation fault occurs during the memcpy. However, using this code:</p>
  
  <pre><code>char str[12];
  memcpy(str, "Hello World\0", 12);
  memcpy(str, "Copy\0", 5);
  </code></pre>
  
  <p>The program does not produce a segmentation fault.</p>
  
  <p>Does the problem arise from allocating the memory on the stack versus the data section?</p>