Instead, you must use the istream member function read . This function accepts the address of a variable or array, plus a number of bytes to read, which is usually specified using sizeof . You can also read a specified number of characters. The parentheses are needed because double is a type name, not a variable name. The answer is usually efficiency.
Binary formats are usually smaller and faster than the human-readable equivalent.
On the other hand, binary formats are frequently non-portable. For example, you can't use the same binary input file for this problem on both Turing and a Windows box. The commands in the input are designed to be easy for a program to process, rather than being easy for a human to read. Each command begins with a single char that specifies an action to take. Each argument has its own format.