1 引用 简单理解引用就是一个变量的另一个名字,从这个名字的角度对变量可以加以修饰,同时拥有const指针的特性 ,所以在声明时必须初始化
2?????const?int?b=4;
3?????int&?ref_a;//必须初始化?:declared?as?reference?but?not?initialized
4?????const?int&?ref_a_const=a;
5?????ref_a++;
6?????ref_a_const++;//只读的:increment?of?read-only?reference?‘ref_a_const’
7?????int&????ref_b=b;//类型不匹配:?invalid?initialization?of?reference?of?type?‘int&’?from?expression?of?type?‘const?int’
8?????const?int&?ref_b_const=b;