S
smnoff
I have been trying to educate myself with all these different uses of const,
i.e.
char *p
const char *p
char * const p
const char * const p
However, there are a few web pages out there that use some really complex
examples:http://c-faq.com/decl/spiral.anderson.htmlI guess these examples
could be all relevant, however, what's the purpose of such use of so many
const and is there an easier way to solve whatever solution? IMPORTANTALSO,
is there a performance penalty when using all these const? Or isit an
increase? I am thinking an increase, but because it looks so convolutedit
could be slow?Lastly, those function pointers, with const pointerscan be
really hard to read. I know I would use a different and more clearer naming
convention than those in the examples.
i.e.
char *p
const char *p
char * const p
const char * const p
However, there are a few web pages out there that use some really complex
examples:http://c-faq.com/decl/spiral.anderson.htmlI guess these examples
could be all relevant, however, what's the purpose of such use of so many
const and is there an easier way to solve whatever solution? IMPORTANTALSO,
is there a performance penalty when using all these const? Or isit an
increase? I am thinking an increase, but because it looks so convolutedit
could be slow?Lastly, those function pointers, with const pointerscan be
really hard to read. I know I would use a different and more clearer naming
convention than those in the examples.