初始化枚举类型的变量

#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; 
}

本文标题为:初始化枚举类型的变量

基础教程推荐