Classes in C++
- classes define the structure and its behavior (operations)
- similar to structs but default is private with classes
- other facilities for object orientation also included in classes (e.g., inheritance…a later topic)
- both structs and classes allow you to define encapsulated data and functions
Interface
- 3 Sections
- public
- data and operations visible, accessible and useable by all clients
- private
- data and operations not visible to other classes
- protected
- visible to subclasses (inheritance)
Previous page
Back to Index
Back to Outline