我是 C 编程新手,所以这可能是一个愚蠢的问题......但我收到以下错误:
45: error: invalid operands to binary % (have .char*. and .int.)
45: error: expected .). before string constant
第 45 行是第二个 printf 函数
一些信息: charsInWord 和 indexOf 都返回一个 int 值
int main()
{
char word [20];
char c;
printf("Enter a word and a character separated by a blank ");
scanf("%s %c", word, &c);
printf("\nInput word is "%c". contains %d input character. Index of %c in it is %d\n", word, charsInWord(word), c, indexOf(word, c));
return 0;
}