Skip to content

Commit

Permalink
enumerated types
Browse files Browse the repository at this point in the history
  • Loading branch information
mblair committed Oct 25, 2010
1 parent 5ce116c commit 01a756e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ch2/as_i_read/enums.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <stdio.h>

typedef enum {
Red, Green, Blue, Yellow, Cyan, Magenta
} colorT;

typedef int colorIntT;

colorT favorite = Blue;
colorIntT favoriteInt = 2;

int main(void) {
printf("My favorite color is %d, also known as %d\n", favorite, favoriteInt);
return 0;
}

0 comments on commit 01a756e

Please sign in to comment.