CSTDIOFILE :: readstring
ps: Difference between text mode file and binary mode fileFile 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 sales. 0x0a byte.
The problem with this paragraph MSDN (from topic: cstdiofile :: readstring) Description: CFILE Operation file The default is binary mode, the CSTDIOFILE class Operation file defaults to Text mode. In Binary mode we must enter '/ r / n', can play the effect of the return line, '/ r' is just a carriage return (return to the first column of the current line), '/ n' just wrap (arrive The current column of a row). And in Text mode's work is automatically completed. When we write a '/ n', the system will automatically help us add one '/ r' in front, then save it to the file.
In addition, cfile :: Typetext can only be used in the cfile subclass, CFILE own read function cannot use CFile :: Typetext and CFile :: Typebinary
MSDN: CSTDIOFILE :: ReadStringnote: The cstringnote t this function; the ltstr version does not.