变量(variable)
其他数据类型在程序运行期间可能会改变或被赋值,这些称为变量(variable)。
常量(constant)
有些数据类型在程序使用之前已经预先设定好了,在整个程序的运行过程中没有变化,这些称为常量(constant)。
命名规范
示例:
/*把年龄转换为天数*/#include <stdio.h>#include <stdlib.h>int main(void){int age = 0; //变量int result = 0;const int DAYS = 365; //常量scanf("%d", &age);result = age * DAYS;printf("%d\n", result);system("pause");}
注:常量的常量名通常用大写表示
