Q:

What is the volatile keyword?

0

What is the volatile keyword?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

The volatile keyword is a type qualifier that prevents the objects from compiler optimization. According to C standard, an object that has volatile-qualified type may be modified in ways unknown to the implementation or have other unknown side effects. You can also say that the value of the volatile-qualified object can be changed at any time without any action being taken by the code. If an object is qualified by the volatile qualifier, the compiler reloads the value from memory each time it is accessed by the program that means it prevents from cache a variable into a register. Reading the value from memory is the only way to check the unpredictable change of the value.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Embedded C interview questions and answers (2022)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
What is the use of volatile keyword?... >>
<< What is the difference between C and embedded C?...