You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
395 B

6 years ago
void add()
{
int i,m=0;
char n;
char ch[2];
FILE *fp;
if((fp=fopen("data.txt","ab+"))==NULL)
{
printf("<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");
exit(0);
}
fseek(fp,0L,2);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: \n");
scanf("%s",inf[m].word);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%s",inf[m].mean);
if(fwrite(&inf[m],LEN,1,fp)!=1)
{
printf("<EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD>");
getchar();
}
else
{
printf("<EFBFBD>ѱ<EFBFBD><EFBFBD><EFBFBD>");
m++;
}
fclose(fp);
}