Hmmm well first of all I see evil old gets() in your program (step slowly away from the computer and it may not attack). Also , you are only checking for periods as far as punctuation goes. There are many ways of doing this sort of thing. I remember seeing this done in "The C Programming Language" a couple of times. If you need to keep track of the sentences then you could create a struct like
Code:
struct whatever {
char *sentence;
char **white_space_array;
};
//skeleton code
void read(char *read_in_data, struct whatever *w) {
int i, j;
i = strlen(read_in_data);
j = count_whitespace(read_in_data);
w->sentence = (char *)malloc(i);
if(!w->sentence)
fprintf(stderr, "NULL allocation!\n");
else
strcpy(w->sentence, read_in_data);
w->white_space_array = (char **)malloc(j * sizeof(char *));
replace_all_whitespace_with_space_character(w->sentence);
//now just use strtok or something to tokenize w->sentence and point w->white_space_array to each of the tokens.
}
Don't get mad because I didn't give specific code. It isn't my assignment, and nothing is gained from me doing everything for you.