Type Mapping for Enums

Internally, enum variables are stored in "regular" (simple) variables.

The Tibbo BASIC and C compilers always choose the "smallest" simple type as the storage for an enum.

The order of evaluation is as follows:

Tibbo BASIC

Tibbo C

char

char

byte

unsigned char

short

short

word

unsigned short

long

long

dword

unsigned long


For example, if all the values defined in an enum are within the –128 to +127 range, then the (signed) char type will would selected.