15 | fp=fopen("E:\\dict.txt","a+"); |
18 | fread(&a[i],sizeof(struct dict),1,fp); |
19 | printf(" %s",a[i].word); |
26 | { int i,j;FILE *fp; char*word=0; |
27 | fp=fopen(" E:\\dict.txt","a+"); |
31 | fread(&a[i],sizeof(struct dict),1,fp); |
34 | printf(" %s %s",a[j].word,a[j].mean); |
35 | if(a[i].word!=word) printf("没有该单词 "); |
42 | FILE *fp;struct dict *p; |
44 | scanf("%s",a[0].word); |
46 | scanf("%s",a[0].mean); |
47 | fp=fopen(" E:\\dict.txt","a"); |
48 | fwrite(&a[0],sizeof(struct dict),1,fp); |
49 | fclose(fp);printf("单词已新增"); |
58 | printf("\n\************************\n\** 欢迎使用迷你字典!**\n\ |
59 | ************************\n\ |
65 | ************************\n"); |
66 | cmd = getchar() - '0'; |
69 | case 0: dict_list(); break; |
70 | case 1: find(); break; |
71 | case 2: append(); break; |
转载于:https://my.oschina.net/u/928111/blog/98260