Msdn:
Difference between text mode file and binary mode file
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:
A. retain the current default setting and specify the alternative mode only when you open selected files.
B. Change the default translation mode directly by setting the global variable _ fmode in your program. The initial default setting of _ fmode is _ o_text, for text mode.
Text mode provides special processing for carriage return-linefeed pairs. when you write a newline character (0x0a) to a text-mode cstdiofile object, the byte pair (0x0d, 0x0a) is sent to the file. when you read, the byte pair (0x0a, 0x0d) is translated to a single 0x0a byte.
Note:
Cstdiofile: readstring
The cstring version of this function removes the '/N' if present; the lptstr version does not.
Note:
The text in the msdn sections (from the topic: cstdiofile: readstring) describes the following issues:
The default cfile file mode is binary, and the default cstdiofile mode is text.
In binary mode, we must enter '/R/N' to start line breaks.'/R' is just a carriage return (return to the first column of the current row ), '/N' is just a line break (to the current column of the next row ).
In text mode, '/R' is automatically completed. When we write a'/N, the system will automatically add a '/R' to the front of the file and save it to the file.
In addition, cfile: typetext can only be used in the cfile subclass. cfile's own read functions cannot use cfile: typetext and cfile: typebinary.