摘要: C++中的const 顶层const和底层const 定义 顶层const代表指针本身是一个常量,而底层const则表示指针指向的对象是一个常量。 int a = 10; const int *p = &a; // 底层const, 不能通过*p改变a,又叫指向常量的指针。 int* const p 阅读全文
posted @ 2022-09-02 21:12 Franky0705 阅读(66) 评论(0) 推荐(0) 编辑