String class e char in C++
<p>When I have </p>

<pre><code>char anything[20];
cout &lt;&lt; sizeof anything;
</code></pre>

<p>it prints 20.</p>

<p>However</p>

<pre><code>string anymore;
cout &lt;&lt; sizeof anymore; // it prints 4
getline(cin, anymore); // let's suppose I type more than one hundred characters
cout &lt;&lt; sizeof anymore; // it still prints 4 !
</code></pre>

<p>I would like to understand how c++ manages this. Thanks</p>
