考虑以下代码:
void foo(unsigned int x) { } int main() { foo(-5); return 0; }
编译没有问题.像这样的错误可能会导致很多问题并且很难找到.为什么C++允许这样的转换?
c++
c++ ×1