File I/O operations take place in one of two translation modes, text or binary, depending on the mode in which the file is opened. Data files are usually processed in text mode. To control the file translation mode, you can:
When you call a file-open function such as _open, fopen, freopen, or _fsopen, you can override the current default setting of _fmode by specifying the appropriate argument to the function. The stdin, stdout, and stderr streams always open in text mode by default; you can also override this default when opening any of these files. Use _setmode to change the translation mode using the file handle after the file is open.