1

const char cstring[] = "cstringline";

如何更改上述代码,以在编译时附加 CRLF 即声明?

4

1 回答 1

9

Unix 行尾:

const char str[] = "foobarbaz\n";

旧版 Mac 行尾:

const char str[] = "foobarbaz\r";

Windows 行尾:

const char str[] = "foobarbaz\r\n";

(但实际上,谷歌......)

于 2013-01-31T06:52:18.663 回答