This week is a software testing practice, no classes. Review the program flowchart, er diagram, pad diagram, NS diagram.
What is the size of a class that has been studied? To be exact, a class is just a type definition, and it is no size. Using the sizeof operator for a type name operation, you get the size of the entity with that type. First of all: we want to know what is the instantiation of a class, the so-called instantiation of the class is to allocate a piece of address in memory
Using sizeof to manipulate the class name, the result is that the object of the class occupies a byte size in memory, because the static member variable is not stored in the object, so the result equals the sum of the non-static data members (excluding member functions) plus the extra bytes added by the compiler. The latter relies on different compiler implementations, which are not guaranteed by the C + + standard.
Several principles for determining the class size:
- The sum of the type size of the non-static member data for the class
- The size of a member variable added by the compiler to support some of the language's attributes (for example, pointers to virtual functions)
- In order to optimize access efficiency, the edge adjustment
- Independent of constructors, destructors, and other member functions in a class
Every week must write