warning: assignment discards qualifiers from pointer target type

Well, as you said yourself, pLastLetter is an array of char * pointers, while str is an array of const char. The &str[strIndex-1] expression has type const char*. You are not allowed to assign a const char* value to a char * pointer. That would violate the rules of const-correctness. In fact, what you are doing is an error in C. C compilers traditionally report it as a mere “warning” to avoid breaking some old legacy code.

As for “how to fix it”… It depends on what you are trying to do. Either make pLastLetter an array of const char* or remove the const from str.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)