User manual

200
mikoC PRO for dsPIC
MikroElektronika
Fundamental Types
The fudamental types represent types that cannot be divided into more basic elements, and are the model for
representing elementary data on machine level. The fudamental types are sometimes referred to as unstructured types,
and are used as elements in creating more complex derived or user-dened types.
The fundamental types include:
- Arithmetic Types
- Enumerations
- Void Type
Arithmetic Types
The arithmetic type speciers are built up from the following keywords: void, char, int, oat and double,
together with the prexes short, long, signed and unsigned. From these keywords you can build both integral
and oating-point types.
Integral Types
The types char and int, together with their variants, are considered to be integral data types. Variants are created
by using one of the prex modiers short, long, signed and unsigned.
In the table below is an overview of the integral types – keywords in parentheses can be (and often are) omitted.
The modiers signed and unsigned can be applied to both char and int. In the absence of the unsigned prex,
signed is automatically assumed for integral types. The only exception is char, which is unsigned by default. The
keywords signed and unsigned, when used on their own, mean signed int and unsigned int, respectively.
The modiers short and long can only be applied to int. The keywords short and long, used on their own,
mean short int and long int, respectively.
Type Size in bytes Range
bit
1-bit 0 or 1
sbit
1-bit 0 or 1
(unsigned) char
1 0 .. 255
signed char
1 - 128 .. 127
(signed) short (int)
1 - 128 .. 127
unsigned short (int)
1 0 .. 255
(signed) int
2 -32768 .. 32767
unsigned (int)
2 0 .. 65535
(signed) long (int)
4 -2147483648 .. 2147483647
unsigned long (int)
4 0 .. 4294967295