Question: What is the purpose of the 'volatile' keyword in programming?Answer: 'volatile' is used to indicate that a variable's value may be changed by multiple threads simultaneously, preventing compiler optimizations that assume the variable can only be changed by the current thread.Example:
|
Is it helpful?
Yes
No
Most helpful rated by users:
- What is the difference between a stack and a queue?
- What is the purpose of an index in a database?
- What is the purpose of the \'git\' version control system?