NYC's Blog - Top-Level和Low-Level const 的评论 http://niyanchun.com/top-level-and-low-level-const.html zh-CN 关于const,之前已经在多篇博客里面有介绍过了。我们知道const本身的含义很简单,就是被它修饰的对象不可以改变。但是,当他和指针或是引用一起使用的时候,我们往往比较难区分到底是指针(或引用)... Mon, 22 Mar 2021 09:13:59 +0800 Mon, 22 Mar 2021 09:13:59 +0800 NYC http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-673 http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-673 Mon, 22 Mar 2021 09:13:59 +0800 NYC 感谢指正,已修正!?

]]>
http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-673#comments
NYC http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-672 http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-672 Mon, 22 Mar 2021 09:10:04 +0800 NYC 是的,笔误,已修正?

]]>
http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-672#comments
tina http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-671 http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-671 Sat, 20 Mar 2021 19:06:41 +0800 tina 第二个代码块的第6行,引用是low-level的

]]>
http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-671#comments
慕斯唐 http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-449 http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-449 Mon, 02 Apr 2018 10:07:48 +0800 慕斯唐 const int *const p3 = p2; // 最右边的const是top-level的,即p3指向的对象是const的;最左边的const是low-level的,即p3本身的值不可变
这句话不对,最右边的const是top-level,即p3本身是不可变的,不能胡乱忘别的地方指;最左边的const是low-level,即p3指向的那个对象不能改变

]]>
http://niyanchun.com/top-level-and-low-level-const.html/comment-page-1#comment-449#comments