Demo entry 6760775

122

   

Submitted by anonymous on Sep 18, 2018 at 08:47
Language: C. Code size: 353 Bytes.

enum boolean {NO, YES }; /*枚举常量是另一种类型的常量。枚举是一个常量整型值的列表 */

enum escapes {BELL = '\a', BACKSPACE = '\b', TAB = '\t', NEWLINE = '\n', VTAB = '\v', RETURN = '\r'};
/*在没有显式说明的情况下,enum类型中第一个枚举名的值为0,第二个为1,以此类推。若指定部分枚举名的值,则未指定值的枚举名的值将依着最后一个指定值向后递增。*/

enum months {JAN=1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC }; /*FEB的值为2,MAR的值为3,以此类推 */ 

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).