标签:
#include <iostream> using namespace std; int main(){ short int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int* p = (int*)arr; for(; p <= ((int*)(&arr[10])); ++p){ cout << "*p = " << *p << endl; } return 0; }
0 1 2 3 4 5 6 7 8 9
在内存中存储方式
- 0001 0000 0003 0002 0005 0004 .....
- 设计到内存时,要注意到大端小端的区别
- 输出4个字节
- 1 * 16 ^ 4 + 0 = 65556
标签:
原文地址:http://www.cnblogs.com/Neo-Lc/p/4934511.html