Article ID: 102158
Article Last Modified on 7/5/2005
/*
* Compiler options needed: -GX for 5.0 only
*/
#include <iostream.h>
#include <fstream.h>
// To resolve the problem using Visual C++ 5.0, use the
// following three statements instead of the preceding two:
//
// #include <iostream>
// #include <fstream>
// using namespace std;
void main(void)
{
ofstream os("test.tmp");
for (int i = 0; i < 512; i++)
{
os.put((char)('0' + i % 10));
}
os.put('\n');
os.close();
streampos pos;
ifstream is("test.tmp");
// To resolve this error using Visual C++ 4.x and earlier, use the
// following line to open the ifstream instead of the line above.
// ifstream is("test.tmp", ios::binary);
for (int k = 0; k < 10; k++)
{
pos = is.tellg();
cout << (char)is.get();
}
}
Additional query words: kbVC400bug 8.00 8.00c 9.00
Keywords: kbbug kbfix kbvc500fix kbcpponly kbcode kbcompiler KB102158