Datasheet

TYPES
The mikroC PRO for AVR is a strictly typed language, which means that every
object, function, and expression must have a strictly defined type, known in the time
of compilation. Note that the mikroC PRO for AVR works exclusively with numeric
types.
The type serves:
- to determine the correct memory allocation required initially.
- to interpret the bit patterns found in the object during subsequent access.
- in many type-checking situations, to ensure that illegal assignments are
trapped.
The mikroC PRO for AVR supports many standard (predefined) and user-defined
data types, including signed and unsigned integers in various sizes, floating-point
numbers with various precisions, arrays, structures, and unions. In addition, point-
ers to most of these objects can be established and manipulated in memory.
The type determines how much memory is allocated to an object and how the pro-
gram will interpret the bit patterns found in the object’s storage allocation. A given
data type can be viewed as a set of values (often implementation-dependent) that
identifiers of that type can assume, together with a set of operations allowed with
these values. The compile-time operator
sizeof allows you to determine the size in
bytes of any standard or user-defined type.
The mikroC PRO for AVR standard libraries and your own program and header files
must provide unambiguous identifiers (or expressions derived from them) and types
so that the mikroC PRO for AVR can consistently access, interpret, and (possibly)
change the bit patterns in memory corresponding to each active object in your pro-
gram.
Type Categories
A common way to categorize types is to divide them into:
- fundamental
- derived
The fudamental types represent types that cannot be split up into smaller parts.
They are sometimes referred to as unstructured types. The fundamental types are
void, char, int, float, and double, together with short, long, signed, and
unsigned variants of some of them. For more information on fundamental types,
refer to the topic Fundamental Types.
The derived types are also known as structured types and they include pointers to
other types, arrays of other types, function types, structures, and unions. For more
information on derived types, refer to the topic Derived Types.
149
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5