Three examples of Programming

Source: Internet
Author: User
Three examples of programming (C ++ object model) 1. the program model is like the Str * series functions in C, such as: Char boy [] = "wcfsf"; char P = new char [strlen (boy) + 1]; strcpy (p, boy); I feel that this is implemented within the function and there is no encapsulation concept 2. the abstract data type (ADT) corresponds to the OB design. This is the internal encapsulation of data in the class, and then the public method is provided to the external program. Many of the STL files are like this. 3. object-Oriented model Oo, which is the most difficult topic to discuss is the pointer of the base class and the question of dynamically calling the function of the derived class. When the derived class is assigned to the Base Class pointer, what is changed is only the "size and content Interpretation Method" that points to the memory. OO design is better than OB's elasticity, because ob decides the called function during compilation, oo is determined at runtime, but the read of OO memory and the inference of objects, all OB is more efficient than oo

 

Three examples of Programming

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.