title: C Pointer to arrays
body: <p>I am learning pointers in C.
  When I declare :</p>
  <pre><code>char c1[] =&quot;hello&quot;;
  c1[0] = c1[1];
  printf(&quot;%s\n&quot;, c1);
  </code></pre>
  <p>It prints out <code>eello</code></p>
  <p>But when I do the following:</p>
  <pre><code>char * c2=&quot;hello&quot;;
  c2[0] = c2[1];
  printf(&quot;%s\n&quot;, c2);
  </code></pre>
  <p>it compiles in C# but the program crashes.
  Could you help me clarify what happens in the Stack when I execute the program?</p>