From what I have read on the web and on SO:
const:
- tells the compiler that the variable must not be changed using program instructions.
- consequently, the compiler can optimize the code.
volatile:
- variable is constant but can be change from outside the program.
- tells the compiler to read the variable's value from memory each time.
- tells the compiler not to use optimization with this variable.
If my understanding is correct, so volatile is just another kind of const.
so, what does a line like the one below mean?
const volatile char A = 'C';