?? save.c
字號:
#include"yy.h"
void save(NODE *head)
{
NODE *p;
FILE *fp;
int m=0;
char filename[20];
clrscr();
if(head==NULL)
{ printf("\n\n\n\tno records to save!\n");
return;
}
printf("\n\n\nPlease input the file name that you want to save:\n");
printf("(press enter and use 'file1')\n");
gets(filename);
if(strlen(filename)==0)strcpy(filename,"file1");
if((fp=fopen(filename,"wb"))==NULL)
{printf("can not save file!\nplease choose again\n");
return;
}
printf("\n save file...\n");
p=head;
while(p)
{
fwrite(p,LEN,1,fp);
p=p->next;
m++;
}
fclose(fp);
printf("There are %d records which have been saved\n",m);
printf("Press any key to continute...\n");
getch();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -