Hi. I am new to programming and im having a problem with this code. I have to write a program that reads in a paragraph from a text file, then replace certain words in that text then write the new text out to a new file. Right now all my code does is put the words i'm trying to use to replace at the end of each sentence.
This is the first time I ever ate ice cream. I wish I was the first person who ever ate ice cream.
The very last time I ate ice cream, it gave me a headache. I swore it would be the last time.
All I ever do is eat, eat, eat ... all the time. We all eat too much all the time.
and when the program works it should produce......
This is the second time I ever ate ice cream. I wish I was the first person who ever ate ice cream.
The very last time I ate ice cream, it gave me a headache. I swore it would be the penultimate time.
All I ever do is eat, eat, eat ... some the time. We some eat too much some the time.
You open the file,
create an array of chars.
Read in every file's char using filename.get(arrayname[i]) while you havent hit '\0'
Now, you got all file in chars array.
Find the words, do the changes and print the array out. Printing out will be easiest part as you wont have to worry about anything as all the new lines and such are already in chars array.