我正在从一本书中自学 C,并且我正在尝试创建一个填字游戏。我需要制作一个字符串数组,但不断遇到问题。另外,我对数组不太了解...
这是一段代码:
char word1 [6] ="fluffy", word2[5]="small",word3[5]="bunny";
char words_array[3]; /*This is my array*/
char *first_slot = &words_array[0]; /*I've made a pointer to the first slot of words*/
words_array[0]=word1; /*(line 20)Trying to put the word 'fluffy' into the fist slot of the array*/
但我不断收到消息:
crossword.c:20:16: warning: assignment makes integer from pointer without a cast [enabled by default]
不知道是什么问题......我试图查找如何制作字符串数组但没有运气
任何帮助都感激不尽,
山姆