title: changing a const char *str1 = "abc"
body: <p>Is this good practice? The code compiles and runs but I wonder if this is a good practice to emulate
  In C code,</p>
  
  <ol>
  <li>we write <code>const char *str1 = "abc";</code></li>
  <li>then later, lets say there is a pointer variable <code>char *str2</code> that points to dynamically allocated memory</li>
  <li>and then we do <code>str1 = str2</code> so now both <code>str1</code> and <code>str2</code> point to dynamically allocated memory</li>
  </ol>
  
  <p>So now we have lost track of any pointer to <code>"abc"</code>. Though in this code, we may not need it but I wonder what is the best recommended way to handle these.</p>
  
  <p>The overall problem is that we need a string that initially is declared to abc and later dependent on user input, we may want to use the string supplied by the user.</p>