C++ class methods are user-defined functions that can be used within an instance of the class. We use a dot notation
. before method names to distinguish them from regular functions.
A class method can be defined in two ways:
- Inside the class definition
- Outside the class definition
Inside the Class
Outside the Class
Parameters can also be added to class methods: