Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- typedef struct word {
- int count;
- char *Word;
- } WORD;
- int main()
- {
- int N=0;
- WORD Vocabulary[300000];
- FILE *I;
- char str[1000] , s[100];
- char filename[256];
- printf("Введите название файла:\n ");
- scanf("%s", filename);
- I=fopen(filename,"r");
- if (I==0)
- {
- printf("Файл %s не удалось открыть! \n",filename);
- exit(0);
- }
- while (fgets(str, 1000, I)!=NULL)
- {
- while(strtok(str, " ,.")!=NULL)
- {
- Vocabulary[N].Word=malloc(strlen(s)+1);;
- strcpy(Vocabulary[N].Word, s);
- printf("%s n", Vocabulary[N].Word);
- N++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement