typedef struct{

char givenName[20];

char surName[20];

int id;

double score;

}StudentT;


void Select1(){

FILE *file=NULL;

StudentT stu;


printf("읽을 파일 이름:");

scanf("%s", stu.givenName);

file=fopen(stu.givenName, "r");


if(file==NULL) printf("file open error\n");

while(!feof(file)){

fscanf(file,"%s %d %lf", stu.surName, &stu.id, stu.score);

printf("%s %d %g", stu.surName, stu.id, stu.score);

}

fclose(file);

}


함수로해서 읽을파일 읽어서 결과보고싶은데 에러나서 멈춰버리는데 잘모르겠어요.ㅠㅠ