Question #212683

to write a C++ program which will read the given text file and will produce an

output text file with the name “Email_IDs” which must contain the valid email addresses of

the students mentioned in the input text file.


Expert's answer

#include <fstream>

using namespace std;

int main() {
  string line;
  ifstream in('input.txt');
  ofstream out('Email_IDs');
  if (in.is_open()) {
    while (getline(in, line)) {
      out << line << "\n";
    }
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS