I have a very basic C programming question. Assume that I have the following definition in my code:
- Code: Select all
typedef enum {
FOO, BAR, BAZ, GAZONK
} foo_t;
At least with my C compiler (gcc 4.0 for Mac OS X) variables of type foo_t seem to be stored as 32-bit integers. This is sometimes a bit inconvenient, especially when I need a big array of an enumerated type. I want to be able to use a declaration like
- Code: Select all
foo_t foo_array[FOO_ARRAY_SIZE];
and get an array of unsigned chars. Is this possible?
Tord