Im supposed to be getting the following output:
-- Write that should fail --
The filename is blank or the file could not be opened so the write/append operation could not be completed.
-- Write + Read --
This is the first line. It should disappear by the end of the program.
-- Write + Read --
This is another line. It should remain after the append call.
This call has two lines.
-- Append + Read --
This is another line. It should remain after the append call.
This call has two lines.
This is the final line in the text.txt file. It should come after the line written
by the second write.
-- Testing Nonexistant File Read --
Fitchfork marks for you!
but i get this output:
-- Write that should fail --
The filename is blank or the file could not be opened so the write/append operation could not be completed.
-- Write + Read --
This is the first line. It should disappear by the end of the program.-- Write + Read --
This is another line. It should remain after the append call.This call has two lines.-- Append + Read --
This is another line. It should remain after the append call.This call has two lines.This is the final line in the text.txt file. It should come after the line written by the second write.-- Testing Nonexistant File Read --
Fitchfork marks for you!
Maybe try putting a newline after every fileline?
change content += fileContent; to content += fileContent + endl;
and change cout << endl; to content += endl;