I got compile error (Borland C/C++ 5.1) with
enumerate types. Does anyone know what wrong?
Here is my C program.
Also I have been struggling to find the sizeofCode:#include <stdio.h> typedef enum {NONE, OFF, ON} Light; typedef enum {PRESS, DEPRESS, NONE} Button; typedef enum {RUN, STOP, OFF} State; int main() { Light L; Button B; State S; /* do computation here...*/ return 0; }
(enum) enumerate type. It always display 4 bytes
when I use sizeof(enum) regardless of the number
of identifiers (elements) of enumerate type I created.
I really appreciate your help.



LinkBack URL
About LinkBacks




