Solved

volatile keyword in C++

Posted on 2010-11-29
3
527 Views
Last Modified: 2012-05-10
what is volatile keyword in C++ is meant for?
0
Comment
Question by:svsathwick
3 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 50 total points
ID: 34232640
From the help files:

Objects declared as volatile are not used in certain optimizations because their values can change at any time. The system always reads the current value of a volatile object at the point it is requested, even if a previous instruction asked for a value from the same object.

In other words - you can be certain the value in that variable is corrrect at the time of reading it (not using any cached value)
0
 
LVL 12

Expert Comment

by:enachemc
ID: 34232929
volatile variable: a variable whose value is read from its original address each time it's accessed because the value stored at the original address can be change by concurent threads
0
 

Author Closing Comment

by:svsathwick
ID: 34345907
lacks example
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now