#include
#include
int main(void)
{
FILE *fp = fopen("word.txt", "r");
char *words_p[100];
int words_n[100];
int words_number=0;
char* s;
int i;
while(fscanf(fp,"%[^ \t\n.,!?:]%*c", s)!=EOF)
{
for(i=0; i
if(strcmp(s,words_p[i])==0)
{
words_n[i]++;
break;
}
}
if(i==words_number)
{
words_p[words_number]=(char*)calloc(strlen(s)+1, sizeof(char));
strcpy(words_p[words_number],s);
words_number++;
}
}
fclose(fp);
return 0;
}
뭐가 잘못됐는지 자꾸 실행이 안되네요,,