const
来源:百度文库 编辑:神马文学网 时间:2024/04/29 01:12:52
指针常量,指针本身是常量,参考代码如下:
char ch[5] = "lisi";char * const pstr = ch;pstr = "zhangshan"; //错误*pstr = 'w'; //正确
常量指针,指向常量的指针,指针值可以改变,指向内容不可改变,参考代码如下:char ch[5] = "lisi";char const *pstr = ch;pstr = "wangwu"; //正确*pstr = 'w'; //错误
char ch[5] = "lisi";char * const pstr = ch;pstr = "zhangshan"; //错误*pstr = 'w'; //正确
常量指针,指向常量的指针,指针值可以改变,指向内容不可改变,参考代码如下:char ch[5] = "lisi";char const *pstr = ch;pstr = "wangwu"; //正确*pstr = 'w'; //错误
const
const char *,char const *,char * const
Const,Const函数,Const变量,函数后面的Const
Const,Const函数,Const变量,函数后面的Const
const T vs. T const
const int *p,const * int p,int const *p
const的作用
const关键字(二)
啊const的作用
const的思考
const使用详解
const 变量总结
volitale 和 const 一起使用
第九章 指针与const
const的几点用法
C++中const用法总结
const double EPSINON = 0.000001
C++中 const使用详解
c++中const的应用
c++中const的应用
第九章 指针与const
关于const char*, char const* and char *const 等的区别_闲赋南山
第九章 指针与const - 飞天御剑流
C++就业课程const与static