Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how the compiler treats any volatile variable?Explain with
example.



how the compiler treats any volatile variable?Explain with example...

Answer / daniboy

A volatile variable is one whose VALUE CAN CHANGE
UNEXPECTEDLY. Consequently, the compiler can make NO
ASSUMPTIONS about the value of the variable. In
particular, the optimizer must be careful to RELOAD the
variable every time it is used instead of holding a copy in
a register.
Examples of volatile variables are:

(a) Hardware registers in peripherals (e.g., status
registers)
(b) Non-stack variables referenced within an interrupt
service routine.
(c) Variables shared by multiple tasks in a multi-
threaded application.

Source: 10 Best Questions to would-be Embedded Programmers -
By Nigel Johns

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More C Interview Questions

difference between c and c++?

2 Answers  


c pgm count no of lines , blanks, tabs in a para(File concept)

2 Answers  


print the table 5 in loops

3 Answers  


What is FIFO?

3 Answers  


program to convert a integer to string in c language'

0 Answers  


what is difference between array,strutter,union and pointers

3 Answers   CTS, Lovely Professional University, Mannar Company,


what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }

3 Answers  


Distinguish between actual and formal arguments.

0 Answers  


when will be evaluated as true/ if(x==x==x) a) x=1; b) x=0; c) x=-1; d) none

7 Answers   HCL,


Combinations of fibanocci prime series

0 Answers  


What is formal argument?

0 Answers  


What is the difference between constant pointer and constant variable?

0 Answers   NIIT,


Categories