/* enums.c - Various ways of declaring enumerated types
 */

#include <stdio.h>

typedef enum Weekday {MONDAY, TUESDAY, WEDNESDAY} weekday_t;

int main(){
    enum {MARRIED, SINGLE, DIVORCED} maritalStatus;
    enum color { RED, WHITE, BLUE, GREEN};
    enum color x;
    enum Dates {HASTINGS=1066, DISCOVERY=1492, INDEPENDENCE=1776};
    maritalStatus = SINGLE;
    x = GREEN;
    weekday_t y = TUESDAY;
    enum Dates which = DISCOVERY;
    printf("%d %d %d %d\n", maritalStatus, x, y, which);
    switch (maritalStatus) {
    case MARRIED: printf("You will save on taxes\n");
		  break;
    case SINGLE:  printf("Why?\n");
		  break;
    case DIVORCED: printf("Prepare alimony checks\n");
		  break;
    default:	  printf("Cannot make up your mind?\n");
    }
    return 0;
}

