You mean like const volatile type variblename; , or the difference between the two?
MosaicFuneral
Posting Virtuoso
1,699 posts since Nov 2008
Reputation Points: 888
Solved Threads: 118
Skill Endorsements: 7
const means the program can not modify the value volatile means the value may be arbitrarily modified outside the program.
the two are separate and not mutually exclusive.
use them together, for instance, in the case of reading a hardware status register. const prevents the value from being stomped on, while volatile tells the compiler that this value can be changed at any time external to the program.
this const volatile <type> <variablename> will thus satisfy both requirements and prevent an optimizing compiler from incorrectly optimizing the code, that it would do if only "const" were used.
jephthah
Posting Maven
2,592 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
Skill Endorsements: 5
jephthah
Posting Maven
2,592 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
Skill Endorsements: 5