摘要:
内存对齐 变量的存储不是简单的堆砌,而是要按照一定的规则对齐。Example:// 内存对齐.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <iostream>//#pragma pack(1) //用来设定变量以n字节方式对齐using namespace std;struct st_1{ char a; int b; short c;}; struct st_2{ short c; ... 阅读全文
![](/skins/gray/images/separator.gif)