How can I “reopen” cin and cout in binary mode under DOS and/or OS/2?
This is implementation dependent. Check with your compiler’s documentation. For example, suppose you want to do binary I/O using cin and cout. Suppose further that your operating system (such as DOS or OS/2) insists on translating “\r\n” into “\n” on input from cin, and “\n” to “\r\n” on output to cout or cerr. Unfortunately there is no standard way to cause cin, cout, and/or cerr to be opened in binary mode. Closing the streams and attempting to reopen them in binary mode might have unexpected or undesirable results. On systems where it makes a difference, the implementation might provide a way to make them binary streams, but you would have to check the manuals to find out.