L7_Structs.pptVIP

  • 3
  • 0
  • 约1.79万字
  • 约 65页
  • 2016-12-03 发布于河南
  • 举报
L7_Structs

Enumeration #include stdio.h enum months { JAN = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC }; Typedef enum months Months; int main() { Months month; const char *monthName[] = { , January, February, March, April, May, June, July, August, September, October, November, December }; printf(%-5s%-11s\n, No. , Month); for ( month = JAN; month = DEC; month++ ) printf( %-5d%-11s\n, month, monthName[ month ] ); return 0; } * Enumeration Note for using enum: C complier won’t

文档评论(0)

1亿VIP精品文档

相关文档