title: Dynamic length of strings in C++
body: <p>I've debugged some programs in C++ and I notice a difference between for instance :</p>
  
  <pre><code>char str[] = "It's a test";
  </code></pre>
  
  <p>But when you use string in <code>&lt;string&gt;</code> header, it seems that has a variable length and for instance, the following <strong>is allowed</strong>:</p>
  
  <pre><code>string str1 = "abcdefg";
  str1 = "abc";
  </code></pre>
  
  <p>But this is <strong>not allowed</strong> :</p>
  
  <pre><code>char str[] = "It's a test";
  str = "abc";
  </code></pre>
  
  <p>It won't work! What's the implementation behind that?</p>