First-chance exception in main.exe: 0xC0000005: Access Violation.的问题,急需回答啊求你们了
#include"head.h"
CLASS *head=NULL,*point_class_save,*point_class_go;
FILE *fp=NULL;
extern FILE *fp22;
extern FILE *fp33;
extern FILE *fp44;
void build_class()
{
char class_fall[20];
if(fp==NULL)
{
if((fp=fopen("classes.txt","r"))==NULL)
{
printf("File open error!\n");
exit(0);
}
}
if(fscanf(fp,"%s",class_fall)==4)
{
if(head==NULL)
{
head=(CLASS *)malloc(sizeof(CLASS));
strcpy(point_class_save->class_no,class_fall);
point_class_save=head;
point_class_save->next1=NULL;
}
else
{
point_class_go=(CLASS*)malloc(sizeof(CLASS));
point_class_go->next1=NULL;
point_class_save->next1=point_class_go;
point_class_save=point_class_go;
strcpy(point_class_save->class_no,class_fall);
}
build_student();
}
else
{
fclose(fp);
fclose(fp22);
fclose(fp33);
fclose(fp44);
return ;
}
}
这是出错那个文件,运行到if(fscanf(fp,"%s",class_fall)==4)出现First-chance exception in main.exe: 0xC0000005: Access Violation.不知道什么回事,求解啊大神们,急急急!!!! 是你的基础知识不扎实呀。求结贴给分。。。。