Just a niggling question:
If an error occurs, will the file handle be closed?Code:FILE* f = NULL; if ((f = fopen("C:\\test.dat", "w")) == NULL) { std::cerr << "Error writing file" << std::endl; exit(1); } // write or whatever fclose (f);
Just a niggling question:
If an error occurs, will the file handle be closed?Code:FILE* f = NULL; if ((f = fopen("C:\\test.dat", "w")) == NULL) { std::cerr << "Error writing file" << std::endl; exit(1); } // write or whatever fclose (f);
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry