考考你,问题出在哪里
程序代码:int main(void)
{
char f[81];
int a=0;
char ch;
puts("input the array");
gets(f);
puts("put a char");
ch=getchar();
while(f[a]!='\0')
{
if(f[a]==ch)
printf("the first location is %d\n",a);
a++;
}
printf("there is no %s in the array\n",ch);
return 0;
} 上面这段代码运行时,会发生内存访问违规的错误,请你把错误找出来并改正(当然还存在一些逻辑上的错误,但主要以解决运行时错误为主)。









