Basic and Advance C Question:
Download Questions PDF

How can I change their mode to binary?

Answer:

I'm writing a ``filter'' for binary files, but stdin and stdout are preopened as text streams. How can I change their mode to binary?

There is no standard way to do this. On Unix-like systems, there is no text/binary distinction, so there is no need to change the mode. Some MS-DOS compilers supply a setmode call. Otherwise, you're on your own.

Download C Programming Interview Questions And Answers PDF

Previous QuestionNext Question
How can I read/write structures from/to data files?What is the difference between text and binary I/O?