Answer Posted / vishal
What is the significance of volatile keyword?
Volatile keyword is used to inform the compiler not to predict/assume/believe/presume the value of the particular variable which has been declared as volatile.
Why/When do we need volatile ?
In following case we need to use volatile variable.
Memory-mapped peripheral registers
Global variables modified by an interrupt service routine
Global variables within a multi-threaded application
If we do not use volatile qualifier the following problems may arise:
Code that works fine-until you turn optimization on
Code that works fine-as long as interrupts are disabled
Flaky hardware drivers
Tasks that work fine in isolation-yet crash when another task is enabled
Source: http://www.firmcodes.com/volatile-keyword-in-c-and-embedded-system/
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
how do you programme Carrier Sense Multiple Access
I need testPalindrome and removeSpace
#include
What is the use of header?
Explain what are the different data types in c?
What is the total generic pointer type?
What is structure in c language?
Write a program to print numbers from 1 to 100 without using loop in c?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
Distinguish between actual and formal arguments.
What does emoji p mean?
Why functions are used in c?
How does selection sort work in c?
What is the heap in c?
What are the __date__ and __time__ preprocessor commands?