/* Human.h */
#include <string>
class Human {
private:
std::string name;
unsigned int age;
public:
/*构造函数与类同名,在创建对象时被调用,当没有定义构造函数时,系统将调用一个默认的构造函数
* 析构函数,在对象被销毁时调用
*/
Human(std::string str = "Jony", unsigned int num = 20);//带默认参数的重载构造函数, 只在声明的地方写值,定义的地方可以不写
Human::~Human();
void setName(std::string str);
void setAge(unsigned int num);
void getName();
void getAge();
};/* Human.h */
#include <string>
class Human {