while ((c = fgetc(file)) != EOF && isalpha(c));
I'm either looking at a bug or I'm misunderstanding something. I see how this loop consumes the remaining alpha characters in the current word, and how once it breaks out, we reset index
and we go to the next iteration of the for loop, which means we're now looking at the next word.
My question is regarding the apostrophe. Say we're in the loop, and we read (and thus consume) '
. That breaks us out of the loop, we reset index
, and the for loop assumes we're looking at the next word. If I have that much correct, shouldn't any characters in the "too long" word that follow the apostrophe also be consumed, rather than become a new word which it does now?