Есть такой код
#include <iostream>
#include <string>
#include <list>
using namespace std;
class mehanizm
{
private:
static list<mehanizm*> Mehanizm;
protected:
string name;
int massa;
float prise;
static void add(mehanizm* A) { Mehanizm.push_back(A); }
mehanizm() { add(this); }
virtual ~mehanizm();
};
class vyzl : public mehanizm
{
protected:
int codediv;
int numsubs;
public:
void set();
void get();
};
class detal : public mehanizm
{
protected:
int massaeng;
string type;
public:
void set();
void get();
};
class vurib : public mehanizm
{
protected:
int massaemp;
string material;
public:
void set();
void get();
};
mehanizm::~mehanizm()
{
cout << "Deliting information..." << this << endl;
}
void vyzl::set()
{
cout << "Vyzl" << endl;
cout << "name: "; cin >> name;
cout << "Massa: "; cin >> massa;
cout << "prise: "; cin >> prise;
cout << "Division code: "; cin >> codediv;
cout << "Subs number: "; cin >> numsubs;
cout << endl;
}
void vyzl::get()
{
cout << "Vyzl" << endl;
cout << name << endl;
cout << massa << endl;
cout << prise << endl;
cout << codediv << endl;
cout << numsubs << endl;
for (int i = 0; i < 100; i++)
{
cout << "_";
}
cout << endl;
}
void detal::set()
{
cout << "Detal" << endl;
cout << "name: "; cin >> name;
cout << "Massa: "; cin >> massa;
cout << "prise: "; cin >> prise;
cout << "Maassa detali: "; cin >> massaeng;
cout << endl;
}
void detal::get()
{
cout << "Detal" << endl;
cout << name << endl;
cout << massa << endl;
cout << prise << endl;
cout << massaeng << endl;
for (int i = 0; i < 100; i++)
{
cout << "_";
}
cout << endl;
}
void vurib::set()
{
cout << "Vurib" << endl;
cout << "Name: "; cin >> name;
cout << "Massa: "; cin >> massa;
cout << "Prise: "; cin >> prise;
cout << "Massa vuroby: "; cin >> massaemp;
cout << endl;
}
void vurib::get()
{
cout << "Employee" << endl;
cout << name << endl;
cout << massa << endl;
cout << prise << endl;
cout << massaemp << endl;
for (int i = 0; i < 100; i++)
{
cout << "_";
}
cout << endl;
}
int main()
{
vyzl* one = new vyzl();
one->get();
one->set();
one->get();
detal* two = new detal();
two->set();
two->get();
vurib* tree = new vurib();
tree->set();
tree->get();
delete one;
delete two;
delete tree;
system("pause");
return 0;
}
Ошибка