Vote count:
0
Reading Savitch's Problem Solving in C++, std::ifstream::fail is shown as an example to check if a file has been correctly opened (ifstream or ofstream).
I've previously used, as it is what I was first shown, std::ifstream::is_open to perform the same check.
Which is 'better' practice?
Or in the case that either one is called directly after attempting to open, does it make no practical difference?
asked 22 secs ago
Aucun commentaire:
Enregistrer un commentaire