User Defined Types

Along with the built-in primitive data types we can also create our own data types in C++ using enumerations, structures, and classes.

Objectives

Upon completion of this module, you should be able to:

  • Define and use custom class enumerations.
  • Define and use your own data structures with the struct keyword.
  • Define your own classes and initialize objects based on these classes.
  • Add custom constructors and destructors to your classes.
  • Mark the member variables and functions in your classes as public, protected, or private.
  • Add static member variables to your classes.
  • Define classes that can be used to create const objects.
  • Separate class definitions from their implementations using header files.
  • Implement simple object-oriented inheritance with base and derived classes.
  • Create overloaded operators for your custom classes.

Table of contents