释义 |
volatile variable
volatile variable (programming)A variable in a computer program which can bemodified by processes other than the program. For example, avariable that stores the value of a timer chip (either becauseit is located at the address of the hardware device or becauseit is updated on interrupts) needs to be volatile to beuseful.
A static variable, on the other hand, maintains its valueuntil the program changes it or it is no longer needed. Inaddition, volatile variables can be held in the stackwhereas static variables are usually stored in a program'sdata segment. |