C: Why allocate string length in powers of 2? : <p>Why do C programmers often allocate strings (char arrays) in powers of two?</p>

<p>You often see...</p>

<pre><code>char str[128]
char str[512]
char str[2048]
</code></pre>

<p>Less often, you see...</p>

<pre><code>char str[100]
char str[500]
char str[2000]
</code></pre>

<p>Why is that?</p>

<p>I understand the answer will involve memory being addressed in binary... But why don't we often see <code>char str[384]</code>, which is 128+256 (multiple of two).</p>

<p>Why are <em>multiples</em> of two not used? Why do C programmers use <em>powers</em> of two?</p>
