Take the above person type as an example again: class person { std::string name; int age; public: person() : age(5) { } void print() const; }; void person::print() const { std::cout << name << ":" << age << std::endl; /* "name" and "age" are the member variables.
再次以之前的person类型作为例子： class person { std::string name; int age; public: person() : age(5) { } void print() const; }; void person::print() const { cout << name << ";" << this->age << endl; /* "name"和"age"是成员变量。