Type Qualifiers in C and C++

来源:互联网 发布:起凡刷通宝软件 编辑:程序博客网 时间:2024/05/22 05:17

C recognizes three type qualifiers --- const, volatile, and restrict. 

C++ refers to the type qualifiers const and volatile as cv-qualifiers and recognizes the type qualifier restrict as a language extension. 


In both languages, const and volatile are only meaningful in expressions that are lvalues. C++ allows a cv-qualifier to apply to functions, which is disallowed in C. The type qualifier restrict may only be applied to pointers.


0 0
原创粉丝点击