C 常量C Constants

“常量”是可以用作程序中的值的数字、字符或字符字符串。A "constant" is a number, character, or character string that can be used as a value in a program. 使用常量可表示不能修改的浮点、整数、枚举或字符值。Use constants to represent floating-point, integer, enumeration, or character values that cannot be modified.

语法Syntax

constantconstant:
floating-point-constantfloating-point-constant

integer-constantinteger-constant

enumeration-constantenumeration-constant

character-constantcharacter-constant

常量的特征是具有值和类型。Constants are characterized by having a value and a type. 接下来三节将讨论浮点整数字符常量Floating-point, integer, and character constants are discussed in the next three sections. 枚举常量将在枚举声明中介绍。Enumeration constants are described in Enumeration Declarations.

另请参阅See Also

C 的元素Elements of C