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