2.1 Example: super class

In this example, we first define a class that represents a person.

class Person
{
    char name[32];
    bool male;
  protected:
    int personType;
  public:
    const char *getName(void) const;
    bool isMale(void) const;
    void setName(const char *n);
    void setGender(bool isMale);
    Person(void);
};

The actual implementation of the methods is not important. This class does not seem very important at this point.



Copyright © 2006-10-05 by Tak Auyeung