Mail Archives: djgpp/1996/05/02/02:51:24
On Tue, 30 Apr 1996, Thore Herberg wrote:
> Is there a way to persuade "cin" and "cout" to read and write
> data in binary format (like fwrite and fread) ?
The type of the streams connected to the console is set before `main' is
called. If you need to switch them to binary, you can use `setmode'
library function. I don't know if this will work in C++, or whether
there is a more C++-ish way of doing it.
Note that switching stdin to binary has some side effects for
signal-handling mechanism (Ctrl-C doesn't casuse SIGINT when you switch
file handle 0 to binary mode, unless you call `__djgpp_set_ctrl_c').
- Raw text -