where do we use volatile keyword?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I get the current date or time of day in a c program?

661


Explain what header files do I need in order to define the standard library functions I use?

663


The file stdio.h, what does it contain?

682


Is c still relevant?

658


Why is struct padding needed?

645






Are comments included during the compilation stage and placed in the EXE file as well?

686


Do character constants represent numerical values?

856


What is the use of putchar function?

661


What is a static variable in c?

681


What is meant by inheritance?

646


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

1792


Is there a built-in function in C that can be used for sorting data?

759


What are dangling pointers in c?

665


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2238


Can a variable be both constant and volatile?

572