Q&A
Ask and answer questions to make information more available to wider audiences.
Amari Amer @ameramari   07, Apr 2023 12:00 AM
Volatile
What is the main use of the keyword “Volatile”?
answers 1
 
Answer 1
Jakob Analuka @analukajakob   08, Apr 2023 09:29 AM
Just like its name, things can change suddenly and unexpectantly; So it is used to inform the compiler that the value may change anytime. Also, the volatile keyword prevents the compiler from performing optimization on the code. It was intended to be used when interfacing with memory-mapped hardware, signal handlers, and machine code instruction.