3 ms·
It rarely makes sense. Pointer to const is a contact between caller and callee. A signature like char <star>strdup(const char <star>) says "I take a pointer to
by jforberg 7y ago
It rarely makes sense. Pointer to const is a contact between caller and callee. A signature like char <star>strdup(const char <star>) says "I take a pointer to memory that I promise not to modify, and you get a pointer to memory that you may modify".
Const pointer is a statement about the internal variables of a function definition, usually not of any interest outside the function itself and therefore rarely used.
- MauranKilom 7y ago> Const pointer is a statement about the internal variables of a function definition, usually not of any interest outside the function itself and therefore rarely used. ...and in fact not even part of the name mangling (for the exact reason you mentioned): https://godbolt.org/z/1pjecq https://godbolt.org/z/1pjecq