This section will introduce you to the primitive data types used in computing.
The word 'primitive' in this case does not mean 'simple' or 'basic' - it means these data types are fundamental in computer science and so you need to understand them and how to use them.
All data within a CPU is in binary form. For example, a 16 bit computer manipulates and stores 16 bit binary numbers like this
However, that binary number can be used to represent different data types. Declaring a certain data type within a program allows the computer to :-
- Allocate the correct amount of memory to it.
- Limit what kind of data manipulation it is allowed to carry out based on data type.
- Spot programming errors when data types are mixed up e.g trying to use integer instead of floating point.