volatile variable definition programming
A variable in a computer program which can be modified by processes other than the program. For example, a variable that stores the value of a timer chip (either because it is located at the address of the hardware device or because it is updated on interrupts
) needs to be volatile to be useful.
variable, on the other hand, maintains its value until the program changes it or it is no longer needed. In addition, volatile variables can be held in the stack
whereas static variables are usually stored in a program's data segment