Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 11 / example / Person.h
blob: 9a404c4de3d6a38b4cff5b4f269967e60cf2339d (plain) (blame)
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
#pragma once

class Person
{
public:
	Person();
	Person(const char* name, int age);

	Person(const Person& other);

	Person(Person&& other); //move constr
	
	Person& operator=(Person&& other); // move op=

	Person& operator=(const Person& other);
	~Person();

	void setName(const char* name);
	void setAge(int age);

	const char* getName() const;
	int getAge() const;

	void print();


private:

	void copyFrom(const Person& other);
	void free();


	char* name;
	int age;
};