enum days {mon, tue, wed, thu, fri, sat, sun};

typedef enum days days_t;

struct personal_info {
   char name[32];
   int age;
   char *addr;

// typedef a previously defined struct.
typedef struct personal_info person;

// declare a nameless struct and typedef it right away.
typedef struct {
   int x;
   int y;
} pair;

// can typedef primitive types too
typedef int my_int;

int main()
   days_t d;         // just a shorter way of declaring "enum days d"
   person david;     // just a shorter way of declaring "struct personal_info david"
   pair p;
   my_int x;

   d = mon;

   strcpy(david.name, "john");
   david.age = 20;

   p.x = 5;
   p.y = 7;

   x = 42;

   printf("Size of 'person' struct is %ld\n", sizeof(person));
   printf("David's name is %s\n", david.name);
   printf("The pair 'p' is (%d, %d)\n", p.x, p.y);
   printf("'x' is %d\n", x);

   return 0;