#include <iostream>
#include <string.h>
using namespace std;

class Person {
	char *name;
	char *address;
public:
	void store(char *name, char *address);
	void display();
};

int main(){
	Person p1;
	p1.store("田中", "東京");
	Person p2;
	p2.store("佐藤", "大阪");
	
	p2.display();
	p1.display();
}

void Person::store(char *name, char *address)
{
	this->name = new char[strlen(name)];
	strcpy(this->name, name);
	this->address = new char[strlen(address)];
	strcpy(this->address, address);
}

void Person::display()
{
	cout << "名前:" << this->name << "\n";
	cout << "住所:" << this->address << "\n";
}