[color=blue][size=large]const[/size][/color]:
The qualifier const can be applied to the declaration of any variable to specify that its value
will not be changed. For an array, the const qualifier says that the elements will not be altered.
The const declaration can also be used with array arguments, to indicate that the function
does not change that array:
[color=blue][size=large]voliate[/size][/color]:
优化器在用到这个变量时必须每次都小心地从内存重新读取这个变量的值,而不是使用保存在寄存器里的备份。
ATT:《内联、联合体及Voliate.doc》
The qualifier const can be applied to the declaration of any variable to specify that its value
will not be changed. For an array, the const qualifier says that the elements will not be altered.
const double e = 2.71828182845905;
const char msg[] = "warning: ";The const declaration can also be used with array arguments, to indicate that the function
does not change that array:
int strlen(const char[]);[color=blue][size=large]voliate[/size][/color]:
优化器在用到这个变量时必须每次都小心地从内存重新读取这个变量的值,而不是使用保存在寄存器里的备份。
ATT:《内联、联合体及Voliate.doc》
本文详细介绍了C++中const关键字的作用,用于声明不可更改的变量,并解释了volatile限定符如何确保编译器每次访问变量时都从内存中读取最新值。
1840

被折叠的 条评论
为什么被折叠?



