#include <stdio.h>
#include <string.h>

class Person {
public:
	char name[64];
	void SetName(char *str) { 
		sprintf(name, "my name is: %s", str);
	}

	void GetName() { 
		printf("%s\n", name);
	}
	
	virtual void Action() {
		printf("I pay taxes...\n");
	}
};

class Student : public Person {
public:
	virtual void Action() {
		printf("I study...\n");
	}
};



int main(int argc, char **argv)
{
	Person p1;
	Student p2;
	Person *ptr;
	

	char *buf = new char[256];
	memset(buf,0x41,256);
	p2.SetName(buf);

	ptr = &p1;
	ptr->Action();


	/*
	ptr = &p1;
	ptr->SetName("Joe");
	ptr->GetName();
	ptr->Action();
	
	ptr = &p2;
	ptr->SetName("Bob");
	ptr->GetName();
	ptr->Action();
*/





	return 0;
}