What is wrong with this declaration?
char *add_element[] = {"1","S"};
I get this error when I compile this -
warning: initialization discards qualifiers from pointer target type
What am I doing wrong?
This question is different from Why I get; initializing 'char *' with an expression of type 'const char *' discards qualifiers?. This can be verified by comment written below. Thanks for answering it.
The possible duplicate question is related, but not the same. It is about why void func(const char *ptr) { char *local = ptr; ... } elicits the warning, rather than dealing with an initializer as here. I don't think this question should be closed as a duplicate of that question