I wrote a program that creates a text file with some letters using ofstream. Now I would like to format the text so that the letters are written in groups of 5 and the rows are all the same length( i.e. DANIWEBFORUM becomes DANIW EBFOR UM). To do this the fprintf function seemed the most appropriate. in the following example I use integers, but it is just an example.
To do this the fprintf function seemed the most appropriate
It's not though.
Write a function that takes a string and returns a string that has all the characters from the previous string with a whitespace character inserted in every 5th position (I don't think there's a manipulator for that).