c++中const的几种用法意义
#非常量中
#在函数中,const int func(const int a) const;
##1.修饰返回值 const int func(); 不能修改返回值
##2.修饰函数形参 int func (const int a); 函数体内不能修改形参a的值
##3.修饰类的成员函数 int func() const; 函数体内不能修改成员变量的值,增加程序的健壮性和鲁棒性。
#非常量中
#在函数中,const int func(const int a) const;
##1.修饰返回值 const int func(); 不能修改返回值
##2.修饰函数形参 int func (const int a); 函数体内不能修改形参a的值
##3.修饰类的成员函数 int func() const; 函数体内不能修改成员变量的值,增加程序的健壮性和鲁棒性。