Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Volatile variable

Posted on 1998-08-24
1
Medium Priority
?
252 Views
Last Modified: 2010-05-18
Hi friends,
           please explain what's the use in declaring a
volatile variable as constant.
Thanxs in advance.
0
Comment
Question by:mala082398
1 Comment
 
LVL 2

Accepted Solution

by:
JYoungman earned 0 total points
ID: 1171032
"volatile" indicates that the object is modified by something not directly under the compiler's control (i.e. the hardware itself, or another thread of control).   An example might be the global variable that keeps track of the total number of timer interrupts, or a hardware clock.

You should probably reject the answer I gave to the other version of this question.

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

824 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