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.

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


Please Help Members By Posting Answers For Below Questions

What are pointers? Why are they used?

1248


What is integer constants?

1131


Where can I get an ansi-compatible lint?

1201


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1354


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

2183


What are header files and what are its uses in C programming?

1334


What do you mean by invalid pointer arithmetic?

1130


Can we change the value of static variable in c?

1076


how to find anagram without using string functions using only loops in c programming

3237


What is #include stdio h?

1178


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1981


What is an array? What the different types of arrays in c?

1253


Is multithreading possible in c?

1066


What is wrong in this statement?

1215


Can we use visual studio for c?

1153