网站 分析,全球著名室内设计公司排名,美容院网站建设,有免费查企业的软件吗一、const变量的一些基本特点 ①const修饰的变量不能被修改const int a=10;
a=20;//错误②因为const修饰的变量不能被修改,所以必须被初始化int a=10;
const int b=a; //正确
const int c=10; //正确③const修饰的变量可以赋值给其他值const int a=10;
int b=a;//正确④可以有… 一、const变量的一些基本特点 ①const修饰的变量不能被修改 const int a=10;
a=20;//错误②因为const修饰的变量不能被修改,所以必须被初始化 int a=10;
const int b=a; //正确
const int c=10; //正确③const修饰的变量可以赋值给其他值 const int a=10;
int b=a;//正确④可以有常量引用 int a=10;
const int b=a;二、在其他文件中使用const常量(e