Volatile keyword
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5190091/what-is-the-use-of-volatile-keyword">What is the use of volatile keyword?</a>  </p>
</blockquote>



<p>Why to use <code>volatile</code> keyword in c++? what is the proper use of it?</p>

<p>As per definition </p>

<blockquote>
  <p>The volatile keyword is a type qualifier used to declare that an object can be modified in the program by something such as the operating system, the hardware, or a concurrently executing thread.</p>
</blockquote>

<p>and in examples it decalred for e.g. </p>

<pre><code>volatile bool Isrunning;
Isrunning=true;
</code></pre>

<p>and people use it for e.g. </p>

<pre><code>if(Isrunning)
{
//some code here....
}
</code></pre>

<p>and at the end </p>

<pre><code>Isrunning=false;
</code></pre>

<p>So my question is how it is diferent from <code>bool Isrunning;</code></p>

<p>Thanks in advance.
Dew</p>
