- Microsoft Visual C++ Windows Applications by Example
- Stefan Bjornander
- 313字
- 2021-07-02 12:02:24
Summary
- The object-oriented model rests on the three cornerstones inheritance, encapsulation, and dynamic binding as well as the five relations instance, inheritance, aggregation, connection, and call.
- An object can be created as an instance of a class. A class consists of two types of members: methods (member functions) and fields (member variables). A member can be private, protected, or public. The methods of a class can be divided into constructors, inspectors, modifications, and one destructor.
- A class can inherit one or more, other baseclasses with its members. A method of the baseclass can be virtual, resulting in dynamic binding.
- An array can hold a sequence of objects. The classes of those objects have to have a default constructor or no constructor at all in order for the objects to be thoroughly initialized.
- With the help of pointers and classes, we can create a linked list, which is a very useful structure. With its help, we can construct a stack.
- We can overload the usual operators so they take objects as operands. However, we cannot affect the number of operands, nor the precedence or associativity of the operators.
- We can use the this pointer to access our own object and we can define functions as friends to a class.
- Exception handling is an elegant error handling method. When an error occurs, we throw an exception. The point in the exception may or may not be handled in another part of the code. In either case, we do not have to worry about that when the error occurs.
- We can define template classes, which are instantiated with suitable types when we instantiate objects. We can also define template functions that take parameters of different types.
- We can organize our classes, freestanding functions, and global variables into namespace.
- We can read from and write to text and binary files with the predefined classes
ifstream
andofstream
.
推薦閱讀
- EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g: LITE
- UG NX10.0從新手到高手
- Photoshop數碼攝影后期處理專業技法(第2版)
- 中文版Illustrator 2021完全自學教程
- Adobe創意大學Illustrator產品專家認證標準教材(CS6修訂版)
- 圖解Word 2007圖文排版與辦公應用
- 青少年美育趣味課堂:青少年學攝影修圖
- 圖像處理中的數學修煉(第2版)
- 印象筆記留給你的空間2.0:個人知識管理實踐指南
- Drupal: Creating Blogs, Forums, Portals, and Community Websites
- 輕松玩轉3D One AI
- After Effects影視特效立體化教程:After Effects 2021(微課版)
- Learning the Yahoo! User Interface library
- UG NX 12.0中文版實戰從入門到精通
- Joomla! with Flash