-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstructor_copy.cpp
66 lines (56 loc) · 1.03 KB
/
constructor_copy.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <iostream>
#include <ctime>
using namespace std;
class pet {
private:
int *age;
int *id;
string name;
int *health;
int *mood;
bool *s_ill;
int *satiety;
public:
pet(int x_id) {
age = new int(1);
health = new int(100);
mood = new int(5);
s_ill = new bool(false);
satiety = new int(5);
id = new int;
*id = x_id;
}
~pet() {
delete age;
age = 0;
delete health;
health = 0;
delete mood;
mood = 0;
delete s_ill;
s_ill = 0;
delete id;
id = 0;
}
void set_name(string x_name) { name = x_name; }
int get_age() { return *age; }
int get_health() { return *health; }
int get_mood() { return *mood; }
int get_s_ill() { return *s_ill; }
int get_satiety() { return *satiety; }
void check();
};
void pet::check() {
}
/*void create(){
cout << "Введите имя своего питомца: " << endl;
pet PET(7);
string name;
cin >> name;
PET.set_name(name);
} */
void check() {
}
int main() {
setlocale(LC_ALL, "ru");
}