What is the purpose of volatile keyword in C#?
Where would I need to use this keyword?
I saw the following statement, but I am unable to underst
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.
Normally compiler will assume that some variable will be constant during runtime. This may lead error in checking a registor value repeatedly. Because the register value may be changed by anything. So for these kind of variables should be declared 'volatile' and it be checked each time appears in the code with out any assumption.