How to Explain the purpose of the keyword volatile.

Trainee Asked on August 15, 2019 in C++ Language.
Add Comment
1 Answer(s)

Declaring a variable volatile directs the compiler that the variable can be changed externally. Hence avoiding compiler optimization on the variable reference.

Supporter Answered on August 15, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.