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

Write a C program to print 1 2 3 ... 100 without using loops?

15 Answers   Hindalco,


what is the difference between while and do while?

2 Answers  


write a C code to reverse a string using a recursive function, without swapping or using an extra memory.

9 Answers   Motorola, TCS, Wipro,


what is difference between array,strutter,union and pointers

3 Answers   CTS, Lovely Professional University, Mannar Company,


List some of the static data structures in C?

0 Answers  


What are the two forms of #include directive?

0 Answers   Aspire, Infogain,


If the static variable is declared as global, will it be same as extern?

1 Answers   Samsung,


please give me some tips for the selection in TCS.

3 Answers   TCS,


Write a program to print numbers from 1 to 100 without using loop in c?

0 Answers  


How to explain the final year project as a fresher please answer with sample project

0 Answers  


What are the advantage of c language?

0 Answers  


wite a programme in c to linear search a data using flag and without using flags?

3 Answers   TCS,


Categories