// Final Project // Programmer: Michael William // Editor used: Pad // Compiler used: VC++ 2005 Professional // #include #include #include #include using namespace std; struct mail { string lineFromFile; string address; }; int main() { string File; cout << "Enter the name of the file to be opened: "; getline(cin, File); ifstream fin; fin.open(File.c_str()); if(!fin.good()) throw "I/O error"; if(File.length() < 0) fin.open("fileContainingEmails.txt"); deque myDeque; while(fin.good()) { string lineFromFile; fin >>lineFromFile; getline(fin, lineFromFile); myDeque.push_back(lineFromFile); } int i; string checker = "tell@dfd.ere"; // i just made this to check, it works, int countMail = 0; string eMail; for(i = 0; i < 12; i++) { if(checker[i] == '@')// change this to myDeque[i] == '@' cout << "hey " << endl; } cout << "" << endl; cout << countMail << " email addresses where found! " << endl; cout << "" << endl; if(countMail > 0) { ofstream fout; string outFile; cout << "Where are these email addresses to be sent: " << endl; getline(cin,eMail); fout.open(outFile.c_str()); if(outFile.length() < 0) fout.open("copyPasteMyEmails.txt"); } return 0; }