Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 613 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 613 Bytes

Chapter 9: Basics of Classes

Class Definition

  • build-in types and user defined types
  • data component and method/functions
  • Access control: public and private
  • Put the source code into a header and a CPP

Constructors and Destructors

  • Constructors
  • Default Constructors
  • Destructors
  • Initialization

Using a Class

  • const member functions
  • const member variables
  • static member variables

this pointer

Lab

Create a simple class. Please try to test:

  • access a private member
  • modify a const data member
  • modify a data member in a const function
  • initialize a const data member