C/Type Qualifiers
< CC Type Qualifiers
C type qualifiers add special properties to the variables being declared. C provides the following two keywords:
- const: the const qualifier is used to indicate the variable value can not be changed after its initialization. As an alternative, the #define preprocessor directive can be used to define constant values and these will consume no memory space.
- volatile: the volatile qualifier indicates that variable values can be changed without the current program's knowledge and so the compiler should not optimize away uses of that variable.
Note: a Standard conforming compiler can ignore these qualifiers; nevertheless, it must issue a message when an attempt is made to alter an object declared as const.
Project: Topic:C |
Previous: Data Types and Keywords — C/Type Qualifiers — Next: Storage Classes |
This article is issued from Wikiversity - version of the Thursday, May 08, 2014. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.