Every week must write

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.