! Understanding of C + + classes

Source: Internet
Author: User

C + + classes can be divided into two classes, one is the class of the entity (i.e., the entity Class), and one is the function class (i.e., function Class).

For the class that constructs the entity, including the attribute of this entity already has its own function;

The function class consists of the functions that deal with the entity and some parameters, but these functions are not possessed by the entity itself. This kind of constructor is usually used to pass in parameters, i.e, entities. If the entity has a large amount of data, usually this parameter uses pointers, so you can save memory by getting data in one place.

One way to do this when declaring a class is if the entity class is not normally required.

In the case of a functional class, because the entity is processed, and the entity has a large amount of data, you can use pointers instead of pointers, but in places where the constructors pass in parameters.

! Understanding of C + + classes

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.