Why is assigning a character in a string to itself a bus error? : <p>This works and produces <code>bbcd</code> as I'd expect.</p>

<pre><code>#include &lt;stdio.h&gt;

int main(void) {
    char string[] = "abcd";

    string[0] = string[1];

    printf("%s\n", string);
}
</code></pre>

<p>This is a bus error.</p>

<pre><code>#include &lt;stdio.h&gt;

int main(void) {
    char *string = "abcd";

    string[0] = string[1];

    printf("%s\n", string);
}
</code></pre>

<p>Why?</p>

<p>Valgrind says:</p>

<pre><code>==9909== Process terminating with default action of signal 10 (SIGBUS)
==9909==  Non-existent physical address at address 0x100000FA2
==9909==    at 0x100000F65: main (test.c:6)
</code></pre>
