I am taking a c++ class this semester and I am having trouble with an assignment. You have probably seen it before...
I requires me to write a program that reads a file, extracts only the email addresses from the file, and writes them to another file. I can read the file ok, but when it writes to my output file, it is writing the entire contents of the input file in one big long string, not just the email addresses like I need.
When reading in, you don't check to see that you have an address (a token containing '@') and when writing to your output file you don't separate your tokens with anything. I don't think line 43 is doing what you think it should.