What is the use of declaring a variable volatile... what it means if it is specified volatile?
Goggle "volatile C keyword" see what you get.
The correct question is when should you use it. T answer would be to access hardware registers, memory mapped hardware, and global variables that are written to by an interrupt.