From af355cb13b5cf168000b8461e6dfd89650cb6a86 Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Tue, 5 Apr 2022 20:09:04 +0300 Subject: Add files via upload --- Sem. 07/Person/Person.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'Sem. 07/Person/Person.h') diff --git a/Sem. 07/Person/Person.h b/Sem. 07/Person/Person.h index 4bcfe98..960d96a 100644 --- a/Sem. 07/Person/Person.h +++ b/Sem. 07/Person/Person.h @@ -1 +1,27 @@ -d +#pragma once +#include +class Person +{ + char* name = nullptr; + int age; + + void copyFrom(const Person& other); + void free(); + +public: + Person() = default; + Person(const char* name, int age); + + Person(const Person& other); + Person& operator=(const Person& other); + + const char* getName() const; + int getAge() const; + + void setName(const char* name); + void setAge(int age); + + ~Person(); + void print() const; + +}; -- cgit v1.3.1-23-gd82d