【发布时间】:2019-06-28 07:49:52
【问题描述】:
我的 VC2017 编译器显示此行为,有人可以解释一下这是怎么回事吗?:
long long testLLSigned0 = LLONG_MIN; // OK, equal to -922129006921510580
long long testLLSigned1 = -922129006921510580i64; // Error, invalid suffix i64 on integer constant
long long testLLSigned2 = -922337203685477580i64; // OK!
long long testLLSigned3 = -922337203685477580LL; // OK!
long long testLLSigned4 = -62129006921510911LL; // Error, use of undeclared identifier 62129006921510911LL
long long testLLSigned5 = -62129006921510911i64; // Error, use of undeclared identifier 62129006921510911i64
【问题讨论】:
-
Unicode 字符 'LEFT-TO-RIGHT OVERRIDE' (U+202D) 导致“数字”成为标识符。
-
相关:stackoverflow.com/questions/45469214/… 文字
-922129006921510580与值-922129006921510580不同。 -
@Eljay,感谢您的回答,从未听说过。我该如何解决这个问题?
-
@DrumM 更改编译器(可能)无济于事。您需要编辑文件并删除 unicode 控制字符。
-
来自microsoft docs:[...]
The i64 suffix is still supported but should be avoided because it is specific to Microsoft and is not portable.[...]