Date: Thu, 2 May 1996 09:38:30 +0200 (IST) From: Eli Zaretskii To: Thore Herberg Cc: djgpp AT delorie DOT com Subject: Re: reading binary I/O with iostream In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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').