+2 votes
in C Plus Plus by

Explain the purpose of the keyword volatile.

1 Answer

0 votes
by

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

Related questions

0 votes
asked Jan 9 in C Plus Plus by GeorgeBell
+1 vote
asked Jan 20, 2021 in C Plus Plus by SakshiSharma
...