title: Redefine const char* in C
body: <p>Assume the following code in <code>C</code>:</p>
  
  <pre><code>const char * string = "123";
  if(condition) string = "somethingelse";
  
  printf("%s\n", string);
  </code></pre>
  
  <p>Although I know that it is working (at least with <code>gcc</code> on <code>x86_64</code>) and no compiler warning are being generated, I'm wondering if this is something I should be doing like this or if there is a better alternative.</p>
  
  <p>Note that this question is not a duplicate of <a href="https://stackoverflow.com/questions/9834067/difference-between-char-and-const-char">Difference between char* and const char*?</a> as it explicitly asks if a redefinition of the content of the variable is good practice. The other question is asking for the difference between <code>char*</code> and <code>const char*</code> and the accepted answer does only provide the answer if one already knows what the assignment of another value means. This was unclear to me and is an essential of this question.</p>