+ 1
How to add any letter in a string???
Like i want to add "a"in the end of every word of the sentence "hello how are you"
4 Answers
+ 3
You can use "isspace" from the <cctype> header and the "insert" from the <string> header file in a simple "for loop"....but be careful...as you insert the letter, the space will move to the right and the same space will be picked up again indefinitely, If your stuck let me know...just....have a go.
+ 2
Not so clear about where you want that 'a' to be placed, in beginning, end of word, or in middle, or random position?
To improve clarity, show the result of that "hello how are you" sentence after you add the letter 'a'.