I'm taking an introduction class in C++ and need a little help with an assignment. I need to write a simple program for the following:
Write a complete program that reads from a file. The file is called email.txt and can be found on the c drive under a folder called sentemails. The file can contain only a single entry about a sent email of the following format: email address, date sent, message. Display all three pieces of data to the user.
This is what I've written, but it does not show me the complete information from the file, which I made up and saved(which is just: email address, February 24, 2010, and some message content). I just get one word from the message content, but the email addy and date come up fine. Any help would be greatly appreciated!!!
Note that you probably do not want a comma in the date. ;)
ADDENDUM:
Alternatively, if you place the email address and date each on their own line, you could use getline (without specifying a delimiter) to read them and loop to read the remaining (possibly multi-line) message content.