标题:谁指点一下 找错 谢谢
取消只看楼主
cn00540401
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-11-14
 问题点数:0 回复次数:0 
谁指点一下 找错 谢谢

我的程序能找出正确结果 但最后弹出对话框 某个内存不能为“written"
为什么啊

#include<stdio.h>
#include<string.h>
struct student{
char name[15];
int score;
};
void find(struct student s[]){
char a[15];
printf("\n输入要查找学员的姓名:");
gets(a);
fflush(stdin);
for(int i=1;i<=5;i++){
if(strcmp(a,s[i].name)==0)
printf("%s:%d\n",s[i].name,s[i].score);
}
}
void main(){
struct student s1[5];
int i;
for(i=1;i<=5;i++){
printf("学员%d的信息:",i);
printf("\n姓名:");
gets(s1[i].name);
fflush(stdin);
printf("成绩:");
scanf("%d",&s1[i].score);
fflush(stdin);
}
find(s1);
}

搜索更多相关主题的帖子: 内存 include written 对话框 
2007-11-15 12:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-186128-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.732806 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved