Person类实现
#include "Person.h"
Person::Person(string n, int a, string g): name(n), age(a), gender(g){}
string Person::getName() const{
return name;
}
int Person::getAge() const{
return age;
}
string Person::getGender() const{
return gender;
}
void Person::setName(string n){
name = n;
}
void Person::setAge(int a){
age = a;
}
void Person::setGender(string g){
gender = g;
}
下载地址
用户评论