What Is Volatile Variables?

Volatile variable it is nothing but telling to compiler that this variable will change, its value at anytime by means of anything and compiler, should not make any assumption about this variable.


The programmer just give information to compiler ,that this value of variable will change at anytime without any action being by program,the change will be made by hardware or external source.


Volatile is a storage class, it indicates that the compiler should not perform any optimization on the variable.


Post a Comment

Don't Forget to comment