#includeint main(){3.14; //浮点型常量50; //整型常量'a'; //字符型常量"abc"; //字符串常量}
#includeint main(){const int a = 10; //a是常变量,具有常属性的变量//int arr[a] = {0}; 也会报错,因为[]里要常量,a即使用了const也还是变量}
#include#define MAX 10000int main(){//MAX = 20; 会报错int n = MAX; //n = 10000}
#includeenum Sex{//这种枚举类型的变量的未来可能取值MALE = 3, //赋初值FEMALE = 7,SECRET};int main(){enum Sex s = MALE; //s只能是MALE/FEMALE/SECRETprintf("%d\n", MALE); //输出:3printf("%d\n", FEMALE); //输出:7printf("%d\n", SECRET); //输出:8return 0;}