okay so im writing this program that is suppose to convert any 4 letter word in an input to love, Love if its the first letter of the sentence. For example if i input hate it'll return Love. the issue is i don't know how to get it to convert a whole string of words. it will only if you input for example hate, but wont accept hate hate
Why not use strings to hold the sentences and string::find() and string::replace() to only remove the word "hate" and replace with the word "love"? If you limit your program to replacing 4 letter words, then the word "what" can be replaced to say "hate". I cannot think of any useful applications of this method. You need to narrow the replacement criteria, and do so by using find and replace methods.
well i need to replace any 4 letter word with love, im not sure how to use string::find() and string::replace() since it hasn't been taught in class yet. Using a loop in the code i have above would work, im just confused om how too convert 4 letter words but also keep reading if there is a space
here is a better example of what the program is suppose to do
Original: Like Momma always said, "Be a good chil' and give me hugs".
Modified: Love Momma always love, "Be a love chil' and love me love".