To write the EDDI compiler, I had to write and read binary files. Writing text files is really easy in C++, directly using the < < operator on the stream, but writing binary is a little harder and, I must say, a lot less elegant.
First, to write to a binary file, we have to use the binary flag when we create the file …
