Hello there. It makes things a little less clear when you post some code, but give no clue as to your errors and there are a lot of people on these boards that will go berserk and curse you out about it. Anyways here is a brief program that will retrieve emails from a file, which is basically the same as your code:
Hopefully the above is enough to get you on your way. Output to a file is rather similar to input, but instead of an ifstream you use ofstream.
#include <fstream> // This is required for file streams.
#include <iostream> // This is required for input/output streams. (ie cout)
std::ifstream emailFile("Emails.txt"); // Open a file for inputing.
char* str = s; // A little redundant considering the above line is sufficient for storing input from a file, but will work nontheless.
while(!emailFile.eof()) // Notice eof is a function
emailFile >> str; // Read a line from the file.
std::cout << str << std::endl; // Output the line just read to the screen.
emailFile.close(); // All done so close the file.