这代码那里有问题啊 ,编译不报错,但又不能运行
#include <stdio.h>#define N 1
/*注册模块*/
zhucehao(){
student.qinhao+=103;
printf("%d\n", zhucehao);
}
void save()
{
typedel struct yonghu {
char name[20];
char sex;
int number[18];
int telephone[11];
int qinhao[3];
}YH;
if((ip = fopen("student1.txt","w")) == NULL){
printf("不能打开这个文件\n");
return(1);
}
if(fwrite(&student[N]),sizeof(struct yonghu),1,ip) != 1)
printf("信息写入错误!");
fclose(ip);
}
main()
{
char YN;
FILE *ip;
YH student[N];
printf("请输入注册的个人信息:\n");
printf("名字\t\t性别\t\t电话号码\t\t寝号\n");
scanf("%s\t\t%c\t\t%d\t\t%d\t\t%d\n"student[N].name, &student[N].sex, student[N].number, student[N].telephone, student[N].qinhao);
printf("你确认注册吗?\t\t确认请输入:Y\t取消请输入:N\n");
scanf("%c\n",&YN);
if(YN == 'Y') {
zhucehao();
printf("请记住注册号\n");
save(); /*保存数据*/ /*产生注册号*/
}
else break;
}