030430511C语言课设

030430511C语言课设

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
030430511 0 C-8 0 C < < 1 „{ IaI @ E .C ÑÎ pE 0 1 0 < 0 2 0 < [email protected] 0 3 0< 0 4 0< 0 5 0 0 6 0< 0 7 0<
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8 0 o 2 o 68+ 8+ 8+H 88 + T <T ª* <<C < struct word *creat(void); /* & < diction.txt” < <C < x& */ struct word *insert_a_word(struct word *head, char *wo); /* x& < 28+ I6 */ struct word *insert(struct word *head, char *wo); /* 0 insert_a_word() < << */ struct word *insert_words(struct word *head, char *filename); /* * insert() < */ struct word *del(struct word *head, char *wo); /* < < */ void search(struct word *head, char *wo); /* * */ void list(struct word *head); /* < < */ struct word *delall(struct word *head); /* * */ void write_to_file(struct word *head, char *filename); /* < filename & < diction.txt 0 , * 0
Image of page 2
˛ * */ void Menu_f(); /* < */ 0 main < 2 8+ @ - #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #define LEN sizeof(struct word) /* word 0 */ #define PR printf("********************\n") /* < */ #define PAUSE system("pause"); /* */ #define CLS system("cls"); /* */ int n; / < */ struct word {char w[20]; struct word *next; }; /* < word < */ struct word *create() {FILE *fp; struct word *head,*p1,*p2; head=NULL; n=0; if((fp=fopen("DICTION.txt","r+"))==NULL) {printf("no find"); return(head);} /* */ p1=p2=(struct word )malloc(LEN); /m word */ fscanf(fp,"%s",p1->w); /* */ while(!feof(fp)) / < */ {n=n+1; if(n==1) head=p1; else p2->next=p1; / p2->next 0 p1 < */ p2=p1; /*p2 0 p1 0 ,0 p1 < */ p1=(struct word *)malloc(LEN); fscanf(fp,"%s",p1->w); } p2->next=NULL; /* < */
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
fclose(fp);/*0 */ return(head); } struct word *insert_a_word(struct word *head,char *wo) {struct word *p1,*p2,*p; if(head==NULL) {head=(struct word *)malloc(LEN); n=n+1; strcpy(head->w,wo); head->next=NULL;
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern