删掉了原本正确代码中char*c="abcd";的内容而下边加了两行printf 和 scanf 为什么就不行了呢
int MyStrlen(const char*c)
{
int count = 0;
while (*c!= 0)
{
++count;
++c;
}
return count;
}
int main()
{
char *c;
printf("Input the string:");
scanf("%s",&*c);
printf("The length of the string is %d\n", MyStrlen(c));
return 0;
}