jeudi 21 mai 2015

ifstream and ofstream or fstream using in and out

When dealing with files, which of the two examples below is preferred? Does one provide better performance than the other? Is there any difference at all?

ifstream input("input_file.txt");
ofstream output("output_file.txt");

vs

fstream input("input_file.txt",istream::in);
fstream output("output_file.txt",ostream::out);

Aucun commentaire:

Enregistrer un commentaire