3.14-1 类型详述
作者:互联网
- 上溢出 / 下溢出
#include <iostream>
#include <limits>
int main()
{
std::cout << sizeof(int) << "\n";
std::cout << std::numeric_limits<int>::min() << "\n";
std::cout << std::numeric_limits<int>::max() << "\n";
unsigned int x = 10;
x = std::numeric_limits<unsigned int>::max() + 1; //上溢出
std::cout << x << "\n";
x = std::numeric_limits<unsigned int>::min() - 1; //下溢出
std::cout << x << "\n";
}
- 对齐信息
- 内存 -> cache -> CPU, 按 cache line 为单位读写
- 查看 cache line size:
/sys/devices/system/cpu/cpu0/cache/index0$ cat coherency_line_size
64
标签:详述,std,cout,cache,3.14,类型,line,溢出,size 来源: https://www.cnblogs.com/levylaw/p/16410818.html