mikroC

making it simple...

TYPES

mikroC - C Compiler for Microchip PIC microcontrollers

C is strictly typed language, which means that every object, function, and expression need to have a strictly defined type, known in the time of compilation. Note that C 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 accesses,

-in many type-checking situations, to ensure that illegal assignments are trapped.

mikroC supports many standard (predefined) and user-defined data types, including signed and unsigned integers in various sizes, floating-point numbers in various precisions, arrays, structures, and unions. In addition, pointers 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 program 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 on those values. The compile-time operator, sizeof, lets you determine the size in bytes of any standard or user-defined type.

The mikroC standard libraries and your own program and header files must provide unambiguous identifiers (or expressions derived from them) and types so that mikroC can consistently access, interpret, and (possibly) change the bit patterns in memory corresponding to each active object in your program.

Type Categories

The fudamental types represent types that cannot be separated 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 these.

The derived types are also known as structured types. The derived types include pointers to other types, arrays of other types, function types, structures, and unions.

 

 

page

MikroElektronika: Development tools - Books - Compilers

59