1 const int g_earth = 9.8; 2 const int * pe = &g_earth; //可行 3 4 const int g_moon = 1.3; 5 int * pm = &g_moon; //不可行
实验证明:c++中禁止将const常量的地址赋给非const的指针。
标签:ons art 实验 证明 earth 地址 amp style 不可
1 const int g_earth = 9.8; 2 const int * pe = &g_earth; //可行 3 4 const int g_moon = 1.3; 5 int * pm = &g_moon; //不可行
实验证明:c++中禁止将const常量的地址赋给非const的指针。
标签:ons art 实验 证明 earth 地址 amp style 不可
原文地址:https://www.cnblogs.com/hangaozu/p/8404180.html