title: Segmentation fault (core dumped) using char*
body: <p>i am new to c programming. i am getting Segmentation fault (core dumped) when i am<br>
      trying to print the string. please help.  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  int main()
  {
    char *ptr;
    strcpy(ptr, "mystring");
    printf( "%s\n", ptr);
   return 0;
  }
  </code></pre>