待补遗(3)[C++]C++与处理大小端相关示例及不同变量内存地址的分配原则
#include
#include
#include
using namespace std;
int main(){
char chs[4] = {0x12, 0x34, 0x56, 0x78};
int *p = reinterpret_cast(chs);
cout<<hex<<*p<<endl;
cout(&chs[0])<<endl
(&chs[1])<<endl
原创
2014-10-24 20:29:50 ·
541 阅读 ·
0 评论