Here is my code for scanning my function,
i need help on storing the word in an array; the program must find 1000 unique words.
i have already implemented a sorting algorithm and am working on the frequency count rite now
Code:
#include<stdio.h>
#include<ctype.h>
#define MAXWORDS 20
#define MAXLETTERS 20
int main(int argc,char *argv[]){
int character=0;
int flag=0;
while(((character=getchar())!=EOF)){
if (ispunct(character) && flag==0){
printf("\n");
flag=1;
}
if (isspace(character) && flag==0){
printf("\n");
flag=1;
}
if (isalpha(character)){
putchar(character);
flag=0;
}
}
return 0;
}