#include "stdafx.h" #include <iostream> using namespace std; struct A{ int i[100]; }; struct B{ void f(); }; void B::f(){ } struct C{ }; int _tmain(int argc, _TCHAR* argv[]) { cout<<sizeof(A)<<endl; //400 cout<<sizeof(B)<<endl; //1 就好像只是占个位置一样 cout<<sizeof(C)<<endl; //1 return 0; }
原文:http://www.cnblogs.com/kateblog/p/5313993.html