What is volatile qualifier?

Showing Answers 1 - 1 of 1 Answers

chaitanyamisal

  • Nov 26th, 2007
 

Volatile
Tells the compiler that the value of the variable can be inadvertently changed by something beyond the scope of the program. So each time the variable is used, its value is loaded from the memory.

example:
The value of variable which is shared by 2 threads can be changed by one thread without the notice of other and the wrong value is used in the program.

The value of the variable can be changed in ISR at anytime though not expected, thus affecting the other part of the program which is using it.


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions