> Not sure whether const applies to pointer or to contents — would like both!
You can have either (or both)
Code:// can change p, but not what it points at. const int *p; p = &foo; // OK p = &bar; // OK *p = 42; // Bad // can change what it points at, but not p itself int * const p = &foo; p = &bar; // Bad *p = 42; // OK // or both const int * const p = &foo; p = &bar; // Bad *p = 42; // Bad