I need to check whether a file is ended with a line break or not, using
if(buffer == '\r' && buffer == '\n') printf("Ended with line break!");
else printf("Not ended with line break!");
For text-mode files, carriage return–linefeed pairs are counted as single characters.
I solved the problem by using
CFile::typeBinary when opening a file.
It seems that
CFile::typeText do something special processing carriage return–linefeed pairs (e.g. filling in a garbage character which is supposed to be a carriage return) which is not desired in my case.