Input/Output to external files, I NEED HELP!!

This is a discussion on Input/Output to external files, I NEED HELP!! within the C++ Programming forums, part of the General Programming Boards category; Please help me!
I am trying to make a program that searches through a .txt file for email adresses. The ...

Input/Output to external files, I NEED HELP!!

Please help me!

I am trying to make a program that searches through a .txt file for email adresses. The best way to separate them I think would be to use something that takes the word from a everything before an @ symbol until a space, coma, semicolon, or greater than or less than symbol, and everything after the @ symbol until 3 letters after the first period that is found.(example

Unfortunately your method is not so full proof. You see... when you open a file, it gets spit out into a buffer that you can then pull from. If you were to read from that buffer until you get to a @ sign, then everything before that would be discarded. Your best bet in doing this would be to open the file, read in a single word and store it into a string, use the std::string's find() function to look for a @ sign. If you find it, then check to make sure it ends with a URL extention. If it does, it's an email.