I'm still reading Prata's book and there is a section where they explain how to write files using the binary mode.
They define a struct
const int LIM = 20;
And they say you can use the binary mode to write the whole struct at once (in text mode you need to specify every member).
I don't understand why they use
ios_base:: out | ios_base::app | ios_base::binary);
fout.write( (char *) &pl, sizeof pl);
instead of just
fout.write( (char *) &pl, sizeof pl)
fout.write( pl, sizeof pl)