#include <stdio.h>
int main()
{
char name[10];
printf("Who are you? \n");
fgets(name,10,stdin);
printf("Good to meet you, %s.\n",name);
if(name=='spyros')
{
printf("Then you are here %s\n",name)
}
return(0);
}
然后我有 警告警告:字符常量对于其类型来说太长
答案 0 :(得分:0)
char只能存储1个字符而不能存储一组字符,并且可以直接将字符串与由于空字符而无法工作的字符数组进行比较
这会有效,希望有所帮助
autoScrolling:false