A type defines which values a variable can hold.
Types of types
The array type is in addition to the first four types.
A variable of boolean type can hold a boolean value, which is either
no (often called
A variable of character type can hold a single UTF-16 character in the Basic Multilingual Plane (BMP) or one of the 16-bit surrogate code points. Characters outside this is stored as two characters, as a surrogate pair. This means that the numeric range of the character type is 16-bit or
0 – 2^16-1.
The void type is only used to say that a function does not return a value.
A type descriptor describes a type.
The type descriptor can either be
- A type name
- An optional array length
- Itenfifier for a data strucutre
Variables are declared with unspecified length. The length is accessible using the array length operator documented as a structural operator.
When allocating an array, the length must be given. An array length consists of square brackets with something that results in a value inside. The value can be a decimal literal, a decimal variable or an expression resulting in a decimal value.