FSTREAM and VECTOR
Trond Bo
trond.bo@dnmi.no
Sun Jan 7 12:17:00 GMT 2001
I tried the two following examples on snapshot
gcc-20001225. Example number one got compiled.
and it did run with the expected result.
Example number did not compile.
The difference is simply where I choose to place
fstream.
Is there something I do wrong or should it be
reported as a bug ?
// -------------------------------------------------
// Example number one
//
#include <fstream>
#include <vector>
using namespace std;
main() { vector<double> i;
i.push_back( 0.01 );
ofstream outfile( "./fil.out", ios::out );
outfile << ( 0.10 + (*(i.begin())) ) << endl;
}
// -------------------------------------------------
// Example number two
//
#include <vector>
#include <fstream>
using namespace std;
main() { vector<double> i;
i.push_back( 0.01 );
ofstream outfile( "./fil.out", ios::out );
outfile << ( 0.10 + (*(i.begin())) ) << endl;
}
More information about the Libstdc++
mailing list