int sloth=3;
const int *ps=&sloth;//不允许用ps的值来修改sloth,可以直接通过修改sloth变量来修改sloth的值。ps可以指向其他的值。
int* const finger=&sloth;//finger只能指向sloth,可以使用finger来修改sloth的值。
*ps和finger都是const,而ps和*finger不是。
int sloth=3;
const int *ps=&sloth;//不允许用ps的值来修改sloth,可以直接通过修改sloth变量来修改sloth的值。ps可以指向其他的值。
int* const finger=&sloth;//finger只能指向sloth,可以使用finger来修改sloth的值。
*ps和finger都是const,而ps和*finger不是。