word
is a string
. A string
is composed of char
s. You cannot store a string
in a string
. You need to store a char
in a string. For example
word[0] = 'a'
is legal, while
word[0] = some_other_string
is not.
Also you cannot initialize a variable with its own value as you did in line 1 of main()