int a = 5;
int b = 19;
int c = 27;
int d = 44;
//const int* p1 = &a; //等同于p3 const在星花左侧叫常量指针
//int const* p3 = &c;
//p1 = &d;
//p3 = &d;
//*p1 = d;
//*p3 = d;
int* const p2 = &b;
*p2 = d;
p2 = &d;
记住常量指针 和指针常量的区别
最新推荐文章于 2025-02-21 17:50:51 发布