1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include <string.h>
#include "person.h"
_person::_person(const char *name) {
this->name = new char[strlen(name) + 1];
strcpy(this->name, name);
age = 0;
}
_person::~_person() {
delete[] name;
}
void _person::birthday() {
age++;
}
void _person::show() {
printf("%s is %d years old.\n", name, age);
}