如题,
#include
#include
#include
struct S{
char a[100];
};
void addStudent(struct S student)
{
FILE fp;
fp=fopen("Student.dat","rb");
if(fp==NULL)
{
printf(" error exit\n");
return;
}
fread(&student,sizeof(struct S),1,fp);
printf("%s\n",student.a);
printf("**************************\n");
fclose(fp);
}
int main()
{
struct S s;
addStudent(s);
return 0;
}