HW2: Types of Computer Data

Read time: 6 minutes (1578 words)

We will be using a version of the Gnu C++ compiler later in this class. We will install this tool when we switch over to the C++ part of the class.

For now, we want to explore some of the ways this language encodes common data so the computer can process it. We will not look at the binary form of this data, just the range of values we can get into a memory container.


Every language tool provides different data types, and the size of the memory containers it sets up can vary depending on the machine you are using. In this class, we will not run into that, but if you start writing code for fun things like the Arduino_ or the Raspberry Pi, two hugely popular tiny computers you can use to control things in your life (not other humans, sadly!)

For this assignment, you need to do a bit of research and see if you can find a list of the data types available in the C++ programming language.

Create a list of the simple single-value data types you find (like numbers, characters, etc), and the range of values allowed for those data types. You may not understand all of what you see, but you should get the basic idea.

What to Turn In

Again, this assignment wants a simple text file. In that file list these things for each data type you identify:

  • Name of the data type

  • How many bits of memory are used for this data type

  • What values can you store here

    • For numbers, that means the biggest and smallest, positive and negative if that is appropriate. Some data types just store codes for values and there is no “range” (character data has no range, but some of the characters are in a logical order!).