My problem is simple - read an input file that has 3 lines of text : This is a test - This is also a test -- This is just another test - each on its own line. Then I need to read through the strings and for each lowercase t change it to upper. I get the code to work for the most part - the only problem I have now is if I run it the way the code is at this point, it prints 15 lines for each , I cannot get the program to print to the screen or the output file each having its own line.
I revamped the code a bit - removed the replace and added an if loop per the instructions from my teacher - but what is happening is this - I have an input file that has 3 lines :
This is a test
This is another test
This is yet another test
the program is supposed to change all lower case t's to upper case T's and then print out just as the input file is with each set of strings on its own line - what is happening is I get it to print and change the t's, however it shows up as one long string on one line - I have tried using an endl; and all that happens is the program breaks each string up into single characters each on its own line - if you have visual studio the code will compile - not sure about other compilers
I think I figured out the problem here - the cout and out statements are both inside the for loop causing the program to print each iteration of the string - I think if I take it out of the for loop it should fix the issue.