c语音学习系列——day11——c的枚举

Posted 不甘平凡,叶育生

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c语音学习系列——day11——c的枚举相关的知识,希望对你有一定的参考价值。

 

枚举表示数字 0,1,2 .....一直累加

 

如下代码:

#include <stdio.h>
#include <string.h>

enum Color
{
pink,red,yellow
};

int main() {

printf("%d\n", red);

enum Color c = yellow;

printf("%d\n", c);

system("pause");

return 0;


}

 

输出结果是

1

2

 

以上是关于c语音学习系列——day11——c的枚举的主要内容,如果未能解决你的问题,请参考以下文章

TypeScript与JavaScript不同之处系列 ===;枚举

C语言学习系列一 C 语言再学习!

Python入门学习-DAY15-模块

VoLTE基础学习系列 | 企业语音网简述

php学习day07笔记(JS数组)

[C++ 系列] 90. 超详解C++思维导图