Const (computer programming): Difference between revisions

Content deleted Content added
m Corrected spelling to "accommodate"
m Pointers and references: I think you mean to the right. "After" is better anyway.
Line 32:
}
 
To render the syntax for pointers more comprehensible, a [[rule of thumb]] is to read the declaration from right to left. Thus, everything before the star can be identified as the pointee type and everything to the leftafter are the pointer properties. (For instance, in our example above, <code>constPtrToConst</code> can be read as a <code>const</code> pointer that refers to a <code>const int</code>.)
 
References follow similar rules. A declaration of a <code>const</code> reference is redundant since references can never be made to point to another object, and many compilers will let it pass only with some warning or error: