"C + + Primer the 15th chapter" Object-oriented programming

Source: Internet
Author: User

OOP: Overview

inheritance : Classes that are linked by inheritance form a hierarchical relationship, usually having a base class at the root of the hierarchy, and other classes inheriting directly or indirectly from the base class, which are derived classes that derive from the class, The base class is responsible for defining members that are common to all classes in a hierarchical relationship, and each derived class defines its own unique members.

virtual functions : In the C + + language, the base class-type-related functions are differentiated from functional relationships in which derived classes do not inherit directly, and for some functions, the base class expects its derived classes to define their own versions, at which point the base class declares these functions as virtual functions.
Base class:

1 class Quote 2 {3      Public : 4         std::stringconst; 5         Virtual Double Const ; 6 };

"C + + Primer the 15th chapter" Object-oriented 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.