I'm not to much familiar with c++ , just wanted to create a text file and write (n) bytes in it , as fast as possible. Using vc6 , any help will be appreciated.
fastest way of writing n bytes in a file in c++
2.4k Views Asked by user2831683 At
2
There are 2 best solutions below
0

Fput is good for strings, fwrite for anything. You can use ofstream, and manipulate with its buffer for perfomance check this: Does C++ ofstream file writing use a buffer? .
Fastest to write bytes... Use
std::fwrite
. Example copied and slightly edited:This might not be what you really want to do, but it is the answer to the question... To get possibly better answer, tell what kind of data you actually want to write and with what constraints (in a new question, after experimenting with this)...