const, register and volatile in C



const tells compiler value will not change.

volatile tells compiler that value is prone to change.

register hints that the variable should be stored in a register.

Generally only const is useful, as the others can be automated by the compiler. Using const allows errors to be detected if the const is not treated as a const in code.