Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么以下行
auto k = -10u;
返回 k = 4294967286 ?它不应该将 10unsigned 类型转换为有符号整数吗?
不,不应该。
-(无符号类型)是无符号类型。
应用于内置整数的任何运算符都具有相同类型的结果