sample1c.c

00001 /*
00002  * sample1c.c
00003  * cl /EP sample1b.c > sample1c.c
00004  * indent -l512 -bl -sob -cli0 -bli0 -i4 --tab-size4 sample1c.c
00005  */
00006 
00007 /* Contents of stdio.h #include deleted */
00008 
00009 struct MyData
00010 {
00011     int value;
00012     const char *myStr;
00013 };
00014 
00015 enum MyEnum
00016 {
00017 
00018     theFirst, theSecond, theThird, theFourth,
00019     MyEnumCount
00020 };
00021 
00022 const char *szzMyEnum[] = {
00023 
00024     "theFirst", "theSecond", "theThird", "theFourth",
00025 };
00026 
00027 const struct MyData myDataList[] = {
00028 
00029     {35, "Buggrit"}, {42, "Millennium"}, {11, "Hand"}, {1, "Shrimp"},
00030 };
00031 
00032 void
00033 MyDataPrint (enum MyEnum e)
00034 {
00035     const struct MyData *found = myDataList + e;
00036     printf ("%d - %s\n", found->value, found->myStr);
00037 }
00038 
00039 int
00040 main (void)
00041 {
00042     MyDataPrint (theFirst);
00043     MyDataPrint (theSecond);
00044     MyDataPrint (theThird);
00045     MyDataPrint (theFourth);
00046     return 0;
00047 }

Generated on Fri Jan 2 15:28:34 2009 for Squat by  doxygen 1.5.6