标签:amp 允许 一个 str const style 声明 code 对象
1 int i=0; 2 int *const p1=&i; //不能改变p1的值,这是一个额顶层const 3 const int ci=42; //不能改变ci的值,这是一个顶层const 4 const int *p2=&ci; //允许改变p2的值,这是一个底层const 5 const int *const p3=p2; 6 //靠右的const 是顶层const ,靠左的是底层const 7 const int &r=ci; //用于声明引用的const 都是底层const
标签:amp 允许 一个 str const style 声明 code 对象
原文地址:https://www.cnblogs.com/mu-ran-2501590635/p/10703307.html