Original Post
hi!
When I allocate an ofstream object on the freestore, I get a 0kb file when I try to write.
Look at the code below. This creates an empty (0kb big) file.
When I create a local instance of ofstream it works.
Does anyone know the problem?
bye
chris
int main()
{
ofstream* fout;
fout=new ofstream;
fout->open("test.txt",ios::binary);
int number = 30;
fout->write((char *)(&number), sizeof(number));
return 0;
}