数据的内存结构问题
#include "stdafx.h"#include <iostream>using namespace std;typedef unsigned char u1;typedef signed char i1;typedef unsigned short u2;typedef signed short i2;typedef unsigned long u4;typedef signed long i4;int _tmain(int argc, _TCHAR* argv[]){ u2 n1 = 11; u2 n2 = 12; u2 n3 = n1<<8 | n2; cout<<n1<<endl; cout<<n2<<endl; u1 *p = (u1 *)&n3; cout<<(int)p[0]<<endl; cout<<(int)p[1]; getchar(); return 0;}