【发布时间】:2017-01-13 01:29:02
【问题描述】:
例如,我将通过此代码获得什么价值,
short int num = 32766
num + 5 = ?
short int 的最大值是 32767。
【问题讨论】:
-
谁知道 - 这就是为什么它被称为“未定义的行为”
-
UB 是 UB 是潜在的release of the kraken。
-
可能溢出了?
-
@synchronizer 有符号整数溢出是 c++ 中的 UB。
-
@synchronizer 它是UB in C too
标签: c++