请大家看看为什么无法输出字符数
#include<stdio.h>#define LENGTH 80
int put2(const*string);
int main(void)
{
char ary[LENGTH];
printf("Enter sth:");
fgets(ary, LENGTH, stdin);
printf("%d Words.\n", put2(ary));
system("pause");
return 0;
}
int put2(const char*string)
{
int count=0;
while (*string)
putchar(*string++);
count++;
putchar("\n");
printf("%d Words\n", count);
if (count = 0)
return NULL;
else
return count;
}