c++中,const是什么意思,const声明的是什么
来源:百度知道 编辑:UC知道 时间:2024/06/08 02:05:52
常量申明,如:
const double PI = 3.14;
申明双精度浮点常数。
const char *str = "hello world";
或
char const *str ="hello world";
申明char型指针,指向字符串常量
char a[10];
char * const str str = a;
申明一个char型常量指针,指向a的地址
class T
{
public:
double val() const{ return val_; } //对函数的修饰,表示类的数据成员值,在该函数中不能被改变
private:
double val_;
}
http://zhidao.baidu.com/question/8105376.html?md=3
声明的是一种不可改变的值.
请问在 C 语言中const与volatile是什么意思?
VB中Const是什么意思啊?
c++中,const是什么意思,const声明的是什么
在C/C++代码中,函数声明括号最后的const是什么意思,有什么用?
C 语言中const与volatile
C++的代码 C operater+( const C& c1,const C& c2){//...} 是什么意思?
vb中private const SC_MOVE = &HF012是什么意思?还有const是什么意思~~
Array<T>::operator T* (void) const 中const是什么意思
C++和C语言中const的区别
VB 在模块中Public Const HALFTONE = 4 是什么意思