title: Difference between char *str = "…" and char str[N] = "…"?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1704407/what-is-the-difference-between-char-s-and-char-s-in-c">What is the difference between char s[] and char *s in C?</a><br>
    <a href="https://stackoverflow.com/questions/4380090/question-about-pointers-and-strings-in-c">Question about pointers and strings in C</a>  </p>
  </blockquote>
  
  
  
  <p>I'm reading about the strings in C and I'm confused. I can "declare" strings in two ways:</p>
  
  <pre><code>char *str = "This is string";
  char str2[20] = "This is string"; 
  </code></pre>
  
  <p>What is the difference between the two declarations? When would <code>char str2[20]</code> be preferred over <code>char *str</code>?</p>