C pointer arithmetic confusion : <p>I have to answer if the following code compiles and which are the results:</p>

<pre><code>char *s1 = "A String";
char *s2 = "Other String";
*s1 = *s2;
</code></pre>

<p>I didnt really find what happens in the background when you do declarations like that. Is s1 pointing to memory looking like this?: </p>

<pre><code>|A| |S|t|r|i|n|g|\0|
</code></pre>

<p>In my understanding <code>*s1 = *s2</code> is the same like <code>s1[0] = s2[0]</code>, right?
So why do I get a memory error?
Shouldnt it be?:</p>

<pre><code>|O| |S|t|r|i|n|g|\0|
</code></pre>
