C + + programming Thought (i)--Introduction to the object

Source: Internet
Author: User

Look back to the C + + programming thought the first chapter, although only a summary of C + + knowledge, and no substantive knowledge points, but the harvest is quite a lot!

The following feeling is to let oneself enlightened, although the meaning is not very accurate, but very image (own language):

1, the class describes a set of objects with the same characteristics (data elements) and the same behavior (function) of the object, is essentially a data type, the existing data type only represents the computer's storage unit, the definition of the new class is to be combined with the problem, solve the problem-----do not think of the class is very complex, directly abstract into this

2, the class to produce work, there will be an interface to achieve the function

3, the program Ape is divided into class creator and client program ape (call other people's class). Client program apes just need to know how to use---involve access control

4, inheritance is very important but do not abuse (involving polymorphism, that is, override, overwrite or overload of the saying all have)

5, Polymorphic is the OOP programming in the late binding mechanism, to add virtual, non-OOP early bundle, the linker call function when you need to know the absolute address

6, data put to the stack (automatic, local variables) and static memory speed faster, sacrificing flexibility, put into the heap can be dynamically created, actually run to know the size

7, exception handling is not OOP features, appear earlier than OOP, but it is very important, can directly with the language or computer systems to deal with.

8, performance and development efficiency are often contradictory, to see their own choice, C + + as far as possible to use the standard library, boost library and other well-known third-party libraries, performance itself is good, of course, can also be optimized in their own, primary and intermediate stages can be correctly called and know the principle of feeling good

9, template and design mode is also very important, like to re-study seriously, a long way to go

10, the choice of managers and decision-makers and reasons are also explained ~~~~~~~ (O-o) ~~~~~

C + + programming Thought (i)--Introduction to the object

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.