Content deleted Content added
→<code>volatile</code>: explained what it actually means |
|||
Line 85:
===<code>volatile</code>===
<!-- This needs love. I've seen no clear explanation of it other than "it's importand for multi-threaded applications"-->
The other qualifier in C and C++, <code>volatile</code>, indicates that an object may be changed by another thread at unexpected times and so must be re-read from memory every time it is accessed. It can be used in exactly the same manner as <code>const</code> in declarations of variables, pointers, references, and member functions, but such use has little semantic value, except in the case of variables. The <code>const_cast</code> keyword can also be used to strip the <code>volatile</code> qualifier.
{{sectstub}}
[[Category:C programming language family]]
|