Skip to main content

Section 18.1 Space Needed to Store Variables

We already have a pretty good idea that different data types take up different amounts of space in memory. For example, to store a character (char) all we need to do is store its ASCII code which, when represented in binary, fits into one byte. On the other hand, most integers (for example the number 999) need more than one byte to store them in binary 2โ€™s complement. And recall that floats are stored in scientific notation as mantissa and exponent - lots of memory needed there. Letโ€™s see how we can make this more precise.

If you cannot see this codecast, please click here.

Aside: Video Description.

Check Your Understanding Check Your Understanding