Comment by cyphar 9 years ago Yeah, I think they confused const * with * const 4 comments cyphar Reply colanderman 9 years ago Nope, * const means that the identifier (i.e. thing to the right of the star) is const. That is, in this example, the symbol "bar" is const, not anything that it points to. So once you dereference it, the const no longer matters. cyphar 9 years ago You're right, I got confused. const is read as "the thing to the right of me is const". const * means const pointer, * const means pointer to const. wruza 9 years ago Vice versa. Const pointer: int *const p; Pointer to const value: const int *p int const *p >const is read as "the thing to the right of me is const"const is one of storage classes and is read at its order, not just "to the right". 1 reply →
colanderman 9 years ago Nope, * const means that the identifier (i.e. thing to the right of the star) is const. That is, in this example, the symbol "bar" is const, not anything that it points to. So once you dereference it, the const no longer matters. cyphar 9 years ago You're right, I got confused. const is read as "the thing to the right of me is const". const * means const pointer, * const means pointer to const. wruza 9 years ago Vice versa. Const pointer: int *const p; Pointer to const value: const int *p int const *p >const is read as "the thing to the right of me is const"const is one of storage classes and is read at its order, not just "to the right". 1 reply →
cyphar 9 years ago You're right, I got confused. const is read as "the thing to the right of me is const". const * means const pointer, * const means pointer to const. wruza 9 years ago Vice versa. Const pointer: int *const p; Pointer to const value: const int *p int const *p >const is read as "the thing to the right of me is const"const is one of storage classes and is read at its order, not just "to the right". 1 reply →
wruza 9 years ago Vice versa. Const pointer: int *const p; Pointer to const value: const int *p int const *p >const is read as "the thing to the right of me is const"const is one of storage classes and is read at its order, not just "to the right". 1 reply →
Nope, * const means that the identifier (i.e. thing to the right of the star) is const. That is, in this example, the symbol "bar" is const, not anything that it points to. So once you dereference it, the const no longer matters.
You're right, I got confused. const is read as "the thing to the right of me is const". const * means const pointer, * const means pointer to const.
Vice versa. Const pointer:
Pointer to const value:
>const is read as "the thing to the right of me is const"
const is one of storage classes and is read at its order, not just "to the right".
1 reply →