Type Qualifiers

The type qualifiers const and volatile are optional in declarations and do not actually affect the type of declared object.

Qualifier const

The const qualifier is used to indicate that variable value cannot be changed. Its value is set at initialization.

The mikroC PRO for PIC32 treats objects declared with the const qualifier the same as literals or preprocessor constants. If the user tries to change an object declared with the const qualifier compiler will report an error.

For example:

const double PI = 3.14159;

Qualifier volatile

The volatile qualifier indicates that variable values can be changed both with or without user’s interference in the program. The compiler should not optimize such variable.

Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
Want more examples and libraries? 
Find them on LibStock - A place for the code