I think OP is confused about what "binary format" means.
The only difference between "binary format" and "textual format" is that the first is not necessarily designed to be read by humans.
For example, suppose I had an integer value:
If I wanted to store that value in a file, I could transform it into a human-readable form, storing the two characters "-7":
1 2 3
|
ofstream outf( "foo.txt" );
outf << x;
outf.close();
|
I could, however, decide to store it directly, without transforming it into something humans can read.
1 2 3
|
ofstream outf( "foo.dat", ios::binary );
outf.write( (const char*)&x, sizeof int );
outf.close();
|
This code has endianness issues, but it suffices to demonstrate the issue.
You can now read the two appropriately:
1 2 3 4 5
|
ifstream inf( "foo.txt" );
int y;
inf >> y;
inf.close();
if (x == y) cout << "Yeah!\n";
|
1 2 3 4 5
|
ifstream inf( "foo.dat", ios::binary );
int y;
inf.read( (char *)&y, sizeof int );
inf.close();
if (x == y) cout << "Yeah!\n";
|
So, by "binary", what we really mean is that there is no textual transformation required. It's the difference between a .docx file and a .txt file. The difference between an .exe and a .cpp.
The 0's and 1's themselves are actually a human way of looking at the information.
JLBorges is providing you information on how to convert your data to/from the human-readable 0's and 1's 'binary' format.
Hope this helps.