Const (computer programming): Difference between revisions

Content deleted Content added
m Fixed grammar
Tags: Mobile edit Mobile app edit iOS app edit
Distinction from constants: rewrite for specificity
Line 22:
 
== Distinction from constants ==
While a constant does not change its value while the program is running, an object declared <code>const</code> may indeed change its value while the program is running. A common example are read only registers within embedded systems like the current state of a digital input. The data registers for digital inputs are often declared as <code>const</code> and <code>[[volatile (computer programming)|volatile]]</code>. The content of these registers may change without the program doing anything (<code>volatile</code>) but youit shallwould notbe ill-formed for the program to attempt write to them either (<code>const</code>).
 
== Other uses ==