ifstream.close() bug ?
Miloslav Grundmann
grundman@mip.ups-tlse.fr
Tue May 19 02:55:00 GMT 1998
// write any integer number in MESH
// type any character chaine
// string.data() and string are not same
// gcc version egcs-2.91.26 19980502 (gcc2 ss-980401 experimental)
// compiled with -DHAIFA on alpha-dec-osf4.0a
void main()
{
int nn;
string input;
ifstream mesh("MESH");
mesh >> nn; // no bug without this line
mesh.close(); // no bug if placed at the end of the file
cout << "Enter character chaine: ";
cin >> input;
cout << "Character chaine.data() = " << input.data() << endl;
cout << "Character chaine = " << input << endl;
}
More information about the Gcc-bugs
mailing list