我问了半天goole,没有找到任何相对应的资料,但是看了很多关于const的介绍:
我的理解是这样的:
通过const 修饰的变量,函数,类,类的成员函数都是不能被修改的。
举个例子:
const int a;//a这个变量不能被修改.
const int *a;(等价于int const *a)//a指针指向的变量不能修改.
int *const a;//a指针的指向不能被修改.
const int function(){}//function返回的值不能被修改.
int function() const{}//funtion函数体里面的所有变量,函数,类都不能被修改.