Mail Archives: djgpp/2000/01/16/07:25:33
On Sat, 15 Jan 2000, Aaron Chernosky wrote:
> Does the function getc(FILE *f) work with binary files, mainly in that
> it doesn't screw up the data when u read it in?
It does, if you open the stream f in binary mode (or switch it to
binary mode using `setmode').
If the stream f is connected to the console, and you want
single-character input, you need to use termios functions (tcsetattr
etc.) to set the terminal for such read mode. See the docs of
tcsetattr and the section called "Termios function" in libc.info for
more details.
- Raw text -