為什么我試了一下不強制轉(zhuǎn)換也可以運行呢?
#include <iostream>
using namespace std;
int main()
{
? ? int a = 100;
? ? short b = a;
? ? cout<<a<<endl<<b<<endl;
? ? return 0;
}
#include <iostream>
using namespace std;
int main()
{
? ? int a = 100;
? ? short b = a;
? ? cout<<a<<endl<<b<<endl;
? ? return 0;
}
2023-05-31
舉報
2023-06-07
程序是可以運行, 大數(shù)值會溢出