初始化枚举类型的变量

#include stdio.h int main(void) { enum Weekday {Monday, Tuesday, Wednesday, Thursday,Friday, Saturday, Sunday} today = Monday, tomorrow = Tuesday;

编程学习网为您整理以下代码实例,主要实现:初始化枚举类型的变量,希望可以帮到各位朋友。

#include <stdio.h> 
int main(voID) { 
  enum Weekday {Monday, Tuesday, Wednesday, Thursday,
                FrIDay, Saturday, Sunday} today = Monday, tomorrow = Tuesday;  

  printf("Weekday created\n");

  printf("%d\n",today);
  printf("%d\n",tomorrow);

  return 0; 
}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐