title: Why are types always a certain size no matter its value?
body: <p>Implementations might differ between the actual sizes of types, but on most, types like unsigned int and float are always 4 bytes. But why does a type always occupy a <em>certain</em> amount of memory no matter its value? For example, if I created the following integer with the value of 255</p>
  
  <pre><code>int myInt = 255;
  </code></pre>
  
  <p>Then <code>myInt</code> would occupy 4 bytes with my compiler. However, the actual value, <code>255</code> can be represented with only 1 byte, so why would <code>myInt</code> not just occupy 1 byte of memory? Or the more generalized way of asking: Why does a type have only one size associated with it when the space required to represent the value might be smaller than that size?</p>