mac-classic

What is the value of '\n' under C compilers for old Mac OS?

爱⌒轻易说出口 提交于 2019-12-18 13:51:24
问题 Background: In versions of Mac OS up to version 9, the standard representation for text files used an ASCII CR (carriage return) character, value decimal 13, to mark the end of a line. Mac OS 10, unlike earlier releases, is UNIX-like, and uses the ASCII LF (line feed) character, value decimal 10, to mark the end of a line. The question is, what are the values of the character constants '\n' and '\r' in C and C++ compilers for Mac OS releases prior to OS X? There are (at least) two possible

What is the value of '\\n' under C compilers for old Mac OS?

对着背影说爱祢 提交于 2019-11-30 10:42:26
Background: In versions of Mac OS up to version 9, the standard representation for text files used an ASCII CR (carriage return) character, value decimal 13, to mark the end of a line. Mac OS 10, unlike earlier releases, is UNIX-like, and uses the ASCII LF (line feed) character, value decimal 10, to mark the end of a line. The question is, what are the values of the character constants '\n' and '\r' in C and C++ compilers for Mac OS releases prior to OS X? There are (at least) two possible approaches that could have been taken: Treat '\n' as the ASCII LF character, and convert it to and from