I am not sure if I understand the Assignment completely.When I wrote the Program it would open the file and also extract the email onto the other file. However, it would not print the Email or extracted Email addresses on the compiler. I've been working on this for last 2 days, my head is smoking. You're working for a company that's building an email list from files of mail messages. They would like you to write a program that reads a file called mail.dat, and that outputs every string containing the @ sign to file addresses.dat. For the purpose of this project, a string is defined as it is by the C++ stream reader - a contiguous sequence of non-whitespace characters.
This is what I got so far:
The problem is the Compiler showes he mail.dat like this: ken.smith@gmail.comexmapleofisherefrom:betty@hotmail.comto:kadcockclevelandstatecc.youknownomoreemail
It is not printing the white spaces.Also I have not figured out how the complier, prints out the data from the address.dat. I really hope you can help me. Thanks
The compiler doesn't have anything to do with the format of mail.dat. If you're referring to the output you display on cout, no.. that won't have spaces. The extraction operator skips all whitespace by default.
Looks like it should do what you want it to, provided mail.dat is formatted correctly. Have you opened up addresses.dat and looked to see what was in it?
Thank you for your replie. In that case, the program does extract the Email addresses correctly and puts them into the addresses.dat. I did check it several times and it all seems to work. Thank you for your help.