title: Clarification of working of strcpy() when char array has been initialized like this *Arr
body: <p>I was trying <code>strcpy</code> like this:</p>
  
  <pre><code>  int main()
    {
      char *c="hello";
      const char *d="mello";
      strcpy(c,d);
      cout&lt;&lt;c&lt;&lt;endl;
      return 0;
    }
  </code></pre>
  
  <p>Compiling this gives a warning and running the code produces a Segmentation fault.</p>
  
  <p>The warning is:</p>
  
  <blockquote>
    <p>warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]<br>
      char *c="hello";</p>
  </blockquote>
  
  <p>The declaration of <code>strcpy</code> is: <code>char * strcpy ( char * destination, const char * source );</code></p>
  
  <ol>
  <li><p>So where am I wrong (regarding the warning)? IMO I have used a <code>const char</code> and a <code>char</code>, same as the function's declaration.</p></li>
  <li><p>Does <code>c*</code> or <code>d*</code> not allocate memory to hold <code>"hello"</code> and <code>"mello"</code>, due to 
  which it is throwing segmentation fault? How does the 
  initialization/definition of a variable like <code>c*</code> work?</p></li>
  </ol>