where do we use volatile keyword?



where do we use volatile keyword?..

Answer / rekha_sri

* A variable should be declared volatile whenever its value
could change unexpectedly.

* A volatile qualifier must be used when reading the contents
of a memory location whose value can change unknown to the
current program.

* A volatile qualifier must be used for shared data modified
in signal handlers or interrupt service routines.

Is This Answer Correct ?    9 Yes 0 No

Post New Answer

More C Interview Questions

There are 8 billiard balls, and one of them is slightly heavier, but the only way to tell was by putting it on a weighing scale against another. What's the fewest number of times you'd have to use the scale to find the heavier ball?

5 Answers   Microsoft, TCS,


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

0 Answers  


Linked list is a Linear or non linear explain if linear how it working as a non linear data structures

0 Answers  


What are the different properties of variable number of arguments?

0 Answers  


define c

6 Answers   HCL, TCS,






Explain what is wrong in this statement?

0 Answers  


Can you subtract pointers from each other? Why would you?

0 Answers  


#include<stdio.h> int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

0 Answers  


How can I find out how much memory is available?

1 Answers   Persistent,


main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}

3 Answers  


can we access one file to one directory?

1 Answers  


What is the difference between malloc() and calloc()?

0 Answers  


Categories