Content deleted Content added
m →C/C++ Syntax: to "C++ syntax" |
|||
Line 128:
===Volatile-correctness===
The other qualifier in C and C++, <code>volatile</code>, indicates that an object may be changed by something external to the program at any time and so must be re-read from memory every time it is accessed.
<code>
Line 141:
</code>
Because <code>hardwareRegister</code> is volatile, there is no guarantee that it will hold the same value on two successive reads even though the programmer cannot modify it. The semantics here indicate that value is read-only but not necessarily unchanging.
We can also create volatile pointers, though their applications are rarer: <code>
Line 155 ⟶ 157:
</code>
Since the address held in the <code>tableLookup</code> pointer can change implicitly, each deference might take us to a different ___location in a memory-mapped look-up table.
==Footnotes==
|