Back

Primitive data types - an introduction

Introduction
There are a range of data types in programming. Every programming language may call each data type by different names. Pascal, for example, can call a real number a 'single' or a 'double'. You will need to look up the names for whichever language you are learning. In addition, there may be some extra data types available. For example, in Pascal, there are the data types byte, shortint, longint and word. These data types are known as 'primitive' because they are the potential building blocks that can be used to create other more complex data types. Primitive data types are not created from other data types. 

Common to most languages (although as we've already said, the actual names may differ) are:

Integer: any whole number e.g. 34, -14

Real number: a number with a fractional part e.g. 4.65, -9.0

Char: any single character from the keyboard.

String: any number of characters from the keyboard.

Boolean: a data type that holds one of two and only two values: TRUE and FALSE.

Back