Assume that Arwen. hclass Arwen {public: Arwen (void); virtual ~ Arwen (void); int Age (); staticvoid Height (int); private: int m_nAge; staticint s_nHeight ;}; category --- class source file Arwen. cpp # include "Arwen. h "int Arwen: s_nHeight = 1; // remember to initialize the static variable Arwen: Arwen (void) {} Arwen ::~ Arwen (void) {} int Arwen: Age () {return m_nAge;} void Arwen: Height (int a) {s_nHeight = ;} suppose that the above class is instantiated, how does one allocate space in the memory? We know that a class includes data members and member functions ). data members are divided into static and nonstatic member functions, which are static and nonstatic. virtual data member memory allocation static variables are allocated in the static storage area (also called data segments. the nonstatic variable allocates space in the object. therefore, static int s_nHeight is used to allocate space in the static storage area, which is not included in the calculation of object space. int m_nAge; it requires the 4-byte space member function to allocate both static and nonstatic member functions in the code area (or text segment. it is not included in the calculation of object content. virtual member functions (no matter how many) ONLY insert a pointer to an object and point to a virtual table (where is this stored? Not yet understood), the virtual table contains a bunch of pointers, a pointer pointing to type information, and others pointing to the virtual function address. virtual functions are stored in the code area like static and nonstatic member functions. since Arwen class has virtual functions, all compilers will automatically insert a pointer pointing to the virtual table, and the pointer is 4 bits on the 32-bit system. therefore, the instantiation class Arwen needs to allocate 8 bytes of memory space. 4 bytes of int m_nAge plus 4 bytes pointer to the virtual table. you can use sizeof (Arwen) to calculate and find that the result is 8.