>But you know what causing compile error for enumerate types I delared in my for program???
Code:
typedef enum {NONE, OFF, ON} Light;
typedef enum {PRESS, DEPRESS, NONE} Button;
typedef enum {RUN, STOP, OFF} State;
Notice that NONE and OFF are used twice each. This is an error as you can only use an enum identifier once in the program. It is usually a good idea to either prefix or postfix your identifiers with the type as well to avoid this little redefinition problem:
Code:
typedef enum { LIGHT_NONE, LIGHT_OFF, LIGHT_ON } Light;
typedef enum { BUTTON_PRESS, BUTTON_DEPRESS, BUTTON_NONE } Button;
typedef enum { STATE_RUN, STATE_STOP, STATE_OFF } State;
-Prelude