AceTheInterview
Jobs in Pune | Work better in teams | Socialize with friends | Submit Q&A | Tell a friend
Search site for 

Top 100 Interview Questions & Answers in a convenient and easy to read book!

“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”

– Ravi, California

Read more comments...

Interview Questions And Answers RSS Feed

Answers »

  1. Submitted By: Prasad Talekar — November 6, 2006
    +12 votes
      + -

    A volatile variable is one that 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:
    • Hardware registers in peripherals (for example, status registers)
    • Non-automatic variables referenced within an interrupt service routine
    • Variables shared by multiple tasks in a multi-threaded application

  2. Submitted By: SAMINFI — May 28, 2007
    +1 votes
      + -

    The volatile variable can be changed outside the runninf of code.for instance if one static variblae x is being used within a function but its vale is not being changed, in this case compiler will optimize the code. But if value is being changed by say CPU or some other thread, compiler can not setect that. SO to avois such condition, the volatile is introduced , which allows compiler not to optimize the code

  3. Submitted By: DREAMER — October 11, 2007
    +1 votes
      + -

    quote from book “The C++ programming language”:

    A volatile specifier is a hint to compiler that an object may chance its value in ways not specified by the language to that aggressive optimization must be avoided.

  4. Leave an Answer/Comment

    To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
    Click to hear an audio file of the anti-spam word

Our Sponsors
Our Sponsors
Contact Us | FAQ | Sitemap | Terms of Use | Privacy Policy | Tell a Friend

Copyright © 1999-2006 Jeeve Technologies LLC. All rights reserved.