char word[LENGTH+1];
while(fscanf(file,"%s",word)!=EOF)
{
node* new_node=malloc(sizeof(node));
strcpy(new_node->word,word)
}
there is error of strcpy()
error: incompatible pointer types passing
'char *[46]' to parameter of type 'char *'
[-Werror,-Wincompatible-pointer-types]
strcpy(new_node->word,word);
^~~~~~~~~~~~~~
/usr/include/string.h:129:39: note: passing argument to
parameter '__dest' here
extern char *strcpy (char *__restrict __dest, const c...
but if i change the line
strcpy(new_node->word,word);
to
strcpy(*new_node->word,word);
^~~~~~~~~~~~~~~~~~~~~
add a start here
then the error warning disappear.
so i wonder how to get the word pointer in a node. need i append a start before the node pointer?
char*
or as achar[LENGTH + 1]
char* [LENGTH+1]
, then i change tochar [LENGTH+1]
, and now it compiles rightly.