-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBrain-Human
83 lines (55 loc) · 1.57 KB
/
Brain-Human
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#pragma once
#include<iostream>
class Brain {
private:
int size;
const double BrainWeigh = 1.5; // kg
const long long int NerveCells = 86000000000;
public:
//Brain() = default;
Brain(int size, double BrainWeigh, const long long int NerveCells); // cstor
Brain(const Brain& otherBrain); //coyp cstor
~Brain(); // decstor
Brain* operator&() const {
return &Brain;
}
std::string identify();
};
#include "Brain.h"
#include <iostream>
Brain::Brain(int BrainSize, double BrainAvgWeigh, const long long int AvgNerveCells)
:
size(BrainSize), BrainWeigh(BrainAvgWeigh), NerveCells(AvgNerveCells)
{
std::cout << "Brain Constructed\n" << std::endl;
}
Brain::Brain(const Brain& otherBrain) : size(otherBrain.size), BrainWeigh(otherBrain.BrainWeigh), NerveCells(otherBrain.NerveCells)
{
std::cout << "Brain Copy Constructed\n" << std::endl;
};
Brain::~Brain()
{
std::cout << "Brain destructed" << std::endl;
}
std::string Brain::identify()
{
Brain* brain_ptr;
std::string brain_memory_address;
brain_ptr = &brain_memory_address;
return brain_memory_address;
}
#include <iostream>
#include <string>
#include "Brain.h"
int main() {
/*std::string exercise_04_string = "Hi thi is brains";
std::string exercise_04_string;
exercise_04_string = "Hi thi is brains";
std::string* pstr = &exercise_04_string;
std::string& rstr = exercise_04_string;
std::cout << "Printed via pointer: " << *pstr << std::endl;
std::cout << "Printed via reference: " << rstr << std::endl; */
Brain test_brain(100, 1.5, 5000);
//Brain test_brain();
//std::cout << &test_brain << std::endl;
}