1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| #include<iostream> using namespace std; class PersonNull { }; class Person { int m_a; static int m_b; void func() {} }; int Person::m_b = 0; void test01() { PersonNull p; cout << "size of p = " << sizeof(p) << endl; } void test02() { Person p; cout << "size of p = " << sizeof(p) << endl; } int main() { test01(); test02(); return 0; }
|