Keyword volatile says that the code related to the variable in question should not be optimized i.e. the code is written on purpose and does not need optimization.
Volatile tells the compiler not to optimize anything that has to do with the volatile variable. There is only one reason to use it: When you interface with hardware.
An example of declaring a simple volatile int type variable would be:
Volatile int x;
Int volatile x;
If you had a pointer variable where the memory pointed to was volatile you could indicate that using:
Volatile int * x;
Int volatile * x;
On the other hand, if you have a pointer variable where the address itself was volatile but the memory pointed to was not then we have:
Int * volatile x;
Last but certainly not least if there was a pointer variable where both the pointer address and the memory pointed to was both volatile then you could do:
Volatile int * volatile x;
Int volatile * volatile x;