we have to read text from an input file and format it by putting so many characters on a line (keeping words together). my problem is that my program counts a space after each character and doesn't put up the right amount of characters.
the test file we use has the alphabet's in order with a space between each letter. when I say that I need three letters on a line it only outputs one but when I say i need four characters on a line it outputs two.