Hello,
I need to make a program that reads each word from a file and replaces the word with the number of its letters and prints it in an output file.
The program works, but in the output each punctuation character shows as "0".
For the words "Hello, my name is." instead of "5 2 4 2" I receive "5 0 2 4 2 0".
I thought the reason was the while statement, but I am not sure anymore.