May 2017
Intermediate to advanced
590 pages
17h 18m
English
For this recipe, you should be familiar with the standard stream input/output library, though some explanations, to the extent required to understand this recipe, are provided below. You should also be familiar with the difference between binary and text files.
In this recipe, we will use the ofstream and ifstream classes, available in the namespace std in the <fstream> header.
In the following examples, we will consider the following data to write to a binary file (and consequently to read back):
std::vector<unsigned char> output {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
Read now
Unlock full access