volatile is used for a variable that could be changed by an outside event, such as the state of an input port. Volatile instructs the compiler to always read the variable value before using it and not optimise it to a register and assume it hasnt changed.
const is used for a constant. It instructs the compiler that the value could be stored in program memory and not use valuable ram space as it will not change throughout the program.
Using both volatile and const on a variable doesnt make sense, you cant have a volatile constant!
bit field's are very useful in embedded systems.
void pointers and bit fields are described in any good book on the C programming language. There is no difference to the language just because the word embedded preceeds it.
void pointers and bit fields are described in any good book on the C programming language. There is no difference to the language just because the word embedded preceeds it.
Bitfields are used in structures and unions.
Bitfields are useful to use as flags. Here is a bitfield that takes a byte of memory but defines 4 flags and a 0 - f counter.