首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

程序那里错了

2013-06-25 
程序那边错了啊void changequestion(exam a[],int b){int i,j,chnoFILE *fpfpfopen(D:\\试题.txt,rb

程序那边错了啊
void changequestion(exam a[],int b)                 
{    int i,j,chno;                                 
     FILE *fp;
     fp=fopen("D:\\试题.txt","rb+");
        if(fp==NULL)
       {
             printf("file cannot be opened");
     exit(1);
       }
            j=0;
printf("请按照题号修改");
    printf("请输入题号:");
        scanf("%d",&chno);                      
{for(i=0;i<b;i++)                     
if(a[i].no==chno) break;}
        printf("请输入题目:");
getchar();
do
{
            a[i].text[j]=getchar();
            j++;
}while(a[i].text[j-1]!='\n');
a[i].text[j-1]='\0';
printf("请输入答案:");
    scanf("%s",a[i].answer);
            for(i=0;i<b;i++)
fwrite(a+i,sizeof(exam),1,fp);
getchar();
printf("修改成功");
getchar();
            fclose(fp);
}
无法修改啊。。。。
[解决办法]
step by step debug

热点排行