#include <stdio.h>
#include <string.h>
#define N 1000
int main(void)
{
char str[N];
int i, lengh;
while(EOF != (scanf("%s", str)))
{
lengh = strlen(str);
for(i = 0;i < lengh;i ++)
{
if(strcmp(str[i], "h") == 0)
printf("I am showing help.\n");
}
}
return 0;
}
main.c:15: warning: passing arg 1 of `strcmp' makes pointer from integer without a cast
:: === Build finished: 0 errors, 1 warnings ===
这样用为什么不可以啊?