首页 > 其他 > 详细

const修饰

时间:2016-02-06 18:26:22      阅读:173      评论:0      收藏:0      [点我收藏+]

const int A() //const // ====>int A(const this)
{
//观点1:const是修饰a,但是通过测试,我们发现,b++也不能编译通过
//这说明:const把a 和 b都修饰了。。。。

//剖析:因为this作为函数的第一个参数,被隐藏。。。。const没有地方放。。。。
//
//const是修饰this

a ++;
//b++;
return a;
}

const修饰

原文:http://www.cnblogs.com/c-slmax/p/5184195.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!