Can anyone please tell me why including a new-style header might give completely different results as compared to including the old-style header in the following fairly trivial case ? Using VC++ 6, I write :
Code: CPP
#include <fstream.h>
class CMyLog : public ofstream
{
public :
CMyLog& operator<<(const char * ptr)
{
ofstream::operator<<(ptr);
return *this;
}
};
int main()
{
CMyLog mylog;
mylog.open("c:\\mylog");
mylog << "hello world";
return 0;
}
#include <fstream>
using namespace std;
Now the mylog file contains the numeric value of a pointer !
Can anyone please tell me what is going on ? I need urgent help.
Thank you
Manish Jain


