Type Mapping for Enums

Top  Previous  Next

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

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 be selected.