如果对有符号类型和无符号数字类型的数字益出还不明白那我举个例子
程序代码:
程序代码:
#include<iostream>
int main()
{
short ch = 32768;
unsigned short ch1=65536;
int ch2=2147483648;
unsigned int ch_2=4294967296;
std::cout<<"32位short有符号益出"<<ch<<'\n';
std::cout<<"32位short无符号益出"<<ch1<<'\n';
std::cout<<"32位int有符号益出"<<ch2<<'\n';
std::cout<<"32位int无符号益出"<<ch_2<<'\n';
}
32位short有符号益出-32768
32位short无符号益出0
32位int有符号益出-2147483648
32位int无符号益出0

把学习时间浪费在混坛上是傻瓜行为,更何况自己的水平连一两都没到。






