Const (computer programming): Difference between revisions

Content deleted Content added
m pointee->apointee - Correct typos in one click
m pointee→pointed - Correct typos in one click
Line 67:
 
==== C++ convention ====
Following C++ convention of analyzing the type, not the value, a [[rule of thumb]] is to read the declaration from right to left. Thus, everything to the left of the star can be identified as the pointeepointed type and everything to the right of the star are the pointer properties. For instance, in our example above, <code>int const *</code> can be read as a writable pointer that refers to a non-writable integer, and <code>int * const</code> can be read as a non-writable pointer that refers to a writable integer.
 
A more generic rule that helps you understand complex declarations and definitions works like this: