May 2017
Intermediate to advanced
590 pages
17h 18m
English
To write the content of a buffer (in our example, an std::vector) to a binary file, you should perform the following steps:
std::ofstream ofile("sample.bin", std::ios::binary);
if(ofile.is_open()) { // streamed file operations }
ofile.write(reinterpret_cast<char*>(output.data()), output.size());
ofile.close(); ...
Read now
Unlock full access