0
dictionary.c:70:20: error: incompatible pointer types passing 'char *[46]' 
to parameter of type 'const char *' [-Werror,-Wincompatible-pointer-types]
    if (strcmp(checker->word, lowword) == 0)
               ^~~~~~~~~~~~~
/usr/include/string.h:144:32: note: passing argument to parameter '__s1' here
extern int strcmp (const char *__s1, const char *__s2)
                           ^
dictionary.c:95:17: error: incompatible pointer types passing 'char *[46]' to parameter of type 'char *' [-Werror,-Wincompatible-pointer-types]
    strcpy (new->word, word);
            ^~~~~~~~~
/usr/include/string.h:129:39: note: passing argument to parameter '__dest' here
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
                                  ^

Can someone please explain why these char* are incompatible?

(First forum post so please excuse and educate me on any bad etiquette.)

0

Welcome to the forum, in fact both variables are different. One, the variable that refers to the strcmp function must be one of the type char *, which previously in the course is known as a string, the one you are passing is of type char **, although you do not write it that way but as char * [46]. This type of variables, as you define it, declares an array of pointers (46 in particular), it is pointers to pointers, I do not know if it is what you want, but you will not be able to use them with the strcmp function in this way .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .