confused

This is a discussion on confused within the C++ Programming forums, part of the General Programming Boards category; I have to read in from input file and if a word in that file is longer than 7 letters ...

confused

I have to read in from input file and if a word in that file is longer than 7 letters insert "er" after the 3 letter of that word. I started by reading the file into a cstring. I know how to find the length of the words I just cant figure out how to insert "er" into the word.

1) read a word from the file
2) if word is > 7
a) copy the first 3 characters to a separate buffer
b) concatenate "er" to the separate buffer
c) concatenate the 4th to the end of the word to the separate buffer
3) do whatever else you need to do with the buffer (display it, etc)
4) repeat step 1 and continue until end of file