I can never keep these straight since I keep forgetting the exact rules around pointer type qualifiers, so for my own reference:
const X * foo; // Cannot change what is being pointed at, can change the pointer foo = &bar; // Allowed *foo = bar; // Not Allowed
X const * foo; // Equivalent to the above
X * const foo; // Cannot change the pointer value, can change what is pointed at foo = &bar; // Not Allowed *foo = bar; // Allowed
const X * const foo; // Cannot change either the pointer value or the target foo = &bar; // Not Allowed *foo = bar; // Not Allowed
To foo, or not to foo. That is the question. Whether ’tis nobler, in code, to add “&” to bar… Or, by opposing disallowed constants and qualifiers, end them…
Bill shoulda been a developer. ;-)