pointer and const – const Struct* const* s ? –
コンテンツ
まず基本から.
const Struct s; // s is a const Struct.
const Struct* s; // s is a (non-const) pointer to a const Struct.
Struct* const s; // s is a const pointer to a (non-const) Struct.
では,
const Struct** s; const Struct* const* s; const Struct* const* const s;
は?
const Struct** s; // s is a (non-const) pointer to a (non-const) pointer to a const Struct.
const Struct* const* s; // s is a (non-const) pointer to a const pointer to a const Struct.
const Struct* const* const s; // s is a const pointer to a const pointer to a const Struct.
混乱する.
以下が参考になる
作成者 Toru Mano
最終更新時刻 2023-01-01 (c70d5a1)