📄 load.c
字号:
/*导入原始数据*/
void load()
{
int i; /*循环变量*/
char file[30]; /*文件的路径名*/
FILE *fp; /*文件指针*/
while(1)
{
clrscr();
for(i=13;i<=67;i++)
{
gotoxy(i,5);
printf("%c",006);
gotoxy(i,20);
printf("%c",006);
}
gotoxy(15,8);
printf("Please intput the path of the file:");
gotoxy(15,10);
scanf("%s",&file); /*输入文件路径名*/
fp=fopen(file,"rb"); /*读取文件*/
if(fp==NULL) /*文件导入出错*/
{
gotoxy(15,12);
printf("Can not open the file!\n");
gotoxy(15,14);
printf("Press any key to giving the right path...");
getch();
continue;
}
for(i=0;i<Maxsize;i++)
if(fread(&student[i],SIZE,1,fp)!=1)
{
k=i; /*获取文件中记录的个数*/
if(feof(fp)) /*文件结束*/
{
fclose(fp);
return;
}
gotoxy(15,12);
printf("File read error\n");
getch();
}
fclose(fp); /*关闭文件*/
return;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -