Calling std::ifstream
destructor causes runtime error and crashes the program. The thing happens on Windows compiling with Borland Compiler 5.5. Unfortunately, I have to use this compiler, so switching to GCC or MSVC is not an option. Here's the sample code:
#include <iostream>
#include <fstream>
using namespace std;
void createDestroyStream()
{
ifstream s1;
cout << "Stream created!" << endl;
}
int main()
{
char c;
createDestroyStream();
cout << "Done!" << endl;
cin >> c;
return 0;
}
The console output shows "Stream created!" and then the process is terminated with error code -1073741510. Can I do something with it?