This segment is supposed to read in a single word and is working properly with one minor failure. when punctuation is introduced instead of ignoring it is reading it in as a blank space.
It looks like it would read the punctuation and then break out of the while loop. It would not be stored in word but the value if i is at were it would have been. So, are you looking at the value of word[i]? Because that has not been assigned.