title: Changing string value using a pointer in C++
body: <p>I am getting a segmentation fault while running the following code :- </p>
  
  <pre><code>char *p ="Hello";
  *p = 'M';
  </code></pre>
  
  <p>what I intended was to replace the first character of the string <code>"Hello"</code> with <code>'M'</code>. But I'm getting segmentation fault. What could be the reason?</p>