/** test.cpp**Created on: 2014.05.23*Author: Spike*//*eclipse cdt, gcc 4.8.1*/#include <iostream>#include <stdio.h>using namespace std;struct a {int x:1;int y:2;int z:33;};int main(){a d;cout << &d << std::endl;d.z = d.x + d.y;printf("%d %d %d %d ", d.x, d.y, d.z, sizeof(d));return 0;}输出:
0x22fed40 0 0 12