Const (computer programming): Difference between revisions

Content deleted Content added
cleanup
re: const references.
Line 19:
 
With anything more complex than that, it probably means a higher-level structure is in order. Any <code>*</code>s or <code>&</code>s in a type apply to everything on their left. So
const char * & * const foo;
is a constant reference to a constant pointer to an array of constant characters, and
char * * const * foo;
is a pointer to a constant pointer to a pointer to a character array.
 
By the nature of references in C++, a constant reference would be meaningless. Creating one may result in a compile error. (References behave very much like constant pointers.)
{{compu-lang-stub}}