#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <stdlib.h>
using namespace std;
class Anti
{
private:
	char* name;
	char* group;
	char* place;
	unsigned int str;

public:
	Anti();
	~Anti();//деструктор*/
	void get();
	void set();
	void show();
};
Anti::Anti()
{
	cout << "Конструктор" << endl;
	name = NULL;
	group = NULL;
	place = NULL;
	str = NULL;
}
Anti::~Anti()
{
	cout << "Деструктор" << endl;
	if (name) { delete[] name; }
	if (group){ delete[] group; }
	if (place) { delete[] place; }
}
void Anti::set()
{
	char* nm;
	char* gr;
	char* pl;
	unsigned int st;
	cout << "Set(): ..." << endl;
	cout << "Название: "; cin >> nm;
	cout << "Группа: "; cin >> gr;
	cout << "Место обитания: "; cin >> pl;
	cout << "Численность популяции: "; cin >> st;
	strcpy(name, nm); cout << name;
	strcpy(group, gr);
	strcpy(place, pl);
	str = st;
}
void Anti::get()
{
	char* nm;
	char* gr;
	char* pl;
	unsigned int st;
	delete[] nm;
	nm = new char[strlen(name) + 1];
	strcpy(nm, name);
	delete[] gr;
	gr = new char[strlen(group) + 1];
	strcpy(gr, group);
	delete[] pl;
	pl = new char[strlen(group) + 1];
	strcpy(pl, group);
	st = str;
}
void Anti::show()
{
	cout << name << " ";
	cout << group << " ";
	cout << place << " ";
	cout << str << " ";
}
int main()
{
	setlocale(LC_ALL, "rus");
	unsigned int st;
	Anti s;
	s.set();
	s.show();
	s.get();
	s.show();
	return 0;
}