Volatile:- Type qualifier for data that changes independently of the program.
Genrally, data is whenever operate on your data the data fetch from memory and store in Register then after
instruction will start.
Example:- Char ch;
ch= 'x'
........
.......
........
to upper (x)
But, we do not want store the data in register only store in memory itself then we use variable as a volatile.
Example:- volatile char ch;
· ch will stay in Memory only.
· The value of volatile variable could be altered externally by some by some other execution thread .
· Volatile variable used in Embeeded Devices.
It looks like you're new here. If you want to get involved, click one of these buttons!