Sunday, 15 April 2012

c++ - print string to file , why extra bits? -


I am using VisualC ++ 2010, I have a large string of 9600000 bytes which I have to print

When I write it in a file, the file size is 9797, 892 bytes big. Why?

I touched the size of the file in debug mode, so I'm sure it is 9600000

  offream output_acci ("output.bin"); Output_asci & lt; & Lt; The_string; Output_asci.close ();    

Try adding the flag ios Binary as argument for ofstream :: open , I think this will work, but I have not tested it.

No comments:

Post a Comment