C++ program to open and read text from a text file character by character. The text file named “test.txt” contains following text:
Hello friends, How are you?
I hope you are fine and learning well.
Thanks and good bye!
The program will read text from the file character by character and display it on the output screen.
Use the following design logic to write the program:
1. Open file in read/input mode using std::in
2. Check file exists or not, if it does not exist terminate the program
3. If file exist, run a loop until EOF (end of file) not found
4. Read a single character using cin in a temporary variable
5. And print it on the output screen
6. Close the file
1
Expert's answer
2017-07-29T07:35:51-0400
Dear Jcullen, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Comments
Leave a comment