title: Assign a string literal to a char*
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/59670/how-to-get-rid-of-deprecated-conversion-from-string-constant-to-char-warnin">How to get rid of <code>deprecated conversion from string constant to ‘char*’</code> warnings in GCC?</a>  </p>
  </blockquote>
  
  
  
  <p>This assignment:</p>
  
  <pre><code>char *pc1 = "test string";
  </code></pre>
  
  <p>gives me this warning:</p>
  
  <blockquote>
    <p>warning: deprecated conversion from string constant to 'char*'</p>
  </blockquote>
  
  <p>while this one seems to be fine:</p>
  
  <pre><code>char *pc2 = (char*)("test string");
  </code></pre>
  
  <p>Is this one a really better way to proceed?</p>
  
  <p>Notes: for other reasons I cannot use a <code>const char*</code>.</p>