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

HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE

3 Answers   Wipro,


What are c identifiers?

0 Answers  


What is c token?

0 Answers  


What is the use of ?: Operator?

0 Answers  


What are the general description for loop statement and available loop types in c?

0 Answers  


what is c programming?

3 Answers   TCS,


Write a program to print "hello world" without using a semicolon?

0 Answers  


How can you access memory located at a certain address?

0 Answers  


what is const volatile?

2 Answers  


what is the definition of storage classes?

3 Answers   Wipro,


What is static and volatile in c?

0 Answers  


Is it better to bitshift a value than to multiply by 2?

0 Answers  


Categories