回复 18楼 rjsp
就是两者之间为什么速度会不一样
2020-03-18 22:06
2020-03-18 22:06
[此贴子已经被作者于2020-3-18 22:41编辑过]
2020-03-18 22:39
2020-03-19 16:51
2020-03-19 18:14
程序代码: #include <iostream>
int main()
{
unsigned short x{ 65535 }; // largest 16-bit unsigned value 2*8。 16possible
std::cout << "x was: " << x << '\n';
x = 65536; // 65536 is out of our range, so we get wrap-around65536超出了我们的范围,因此我们得到了环绕
std::cout << "x is now: " << x << '\n';0
x = 65537; // 65537 is out of our range, so we get wrap-around65537超出了我们的范围,因此我们得到了环绕。 1
std::cout << "x is now: " << x << '\n';
return 0;
}
程序代码:
避免使用无符号
#include <iostream>
int main()
{
unsigned int x{ 3 };
unsigned int y{ 5 };
std::cout << x - y << '\n';
return 0;
}

2020-03-19 19:28

2020-03-20 01:10

2020-03-20 11:01
[此贴子已经被作者于2020-3-20 11:17编辑过]

2020-03-20 11:14

2020-03-20 11:32