编译器对代码1的输出 warning: C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss error: C2001: newline in constant (就指向我添加的唯一的一行代码) error: C2143: syntax error : missing ')' before '}' (指向我的代码下一行)
realfan:LZ的代码原来的格式,无法按GB2312解析。即使编译没有出错,也是运气,不保证能运行时是正常的。 可以在VS的,菜单File->Advanced save options,把Encoding选择成UTF8 with siganature code page65001,保存。再试试 (2015-07-06 11:28)