`
chong_zh
  • 浏览: 69966 次
  • 来自: 杭州
社区版块
存档分类
最新评论

C语言中的const和voliate关键字

 
阅读更多
const:
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[]);


voliate:
优化器在用到这个变量时必须每次都小心地从内存重新读取这个变量的值,而不是使用保存在寄存器里的备份。



ATT:《内联、联合体及Voliate.doc》
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics