Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit874ce5ea43317ba09e5a8d31c1e172b41c33c504 (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-18 20:52:41 +0300
Committer
 GitHub <noreply@github.com>
2019-09-18 20:52:41 +0300
Files9401bdac2b1eb5a5e58b442725c05ef9c9128a62
Object-oriented_programming_FMI-874ce5ea43317ba09e5a8d31c1e172b41c33c504.tar
Object-oriented_programming_FMI-874ce5ea43317ba09e5a8d31c1e172b41c33c504.tar.gz
Object-oriented_programming_FMI-874ce5ea43317ba09e5a8d31c1e172b41c33c504.zip
Parent1be6cc1974176a52f3df9959939d706e53a9d6bc (diff)
Create InformaticsStudent.h
1 files changed, 36 insertions, 0 deletions
-rw-r--r--Big4/InformaticsStudent.h36
diff --git a/Big4/InformaticsStudent.h b/Big4/InformaticsStudent.h
new file mode 100644
index 0000000..ce68e17
--- /dev/null
+++ b/Big4/InformaticsStudent.h
@@ -0,0 +1,36 @@
+
+// Голямта 4-ка - Функции, които трябва да разпишем, САМО когато имаме динамична памет в класа.
+
+// 1.Defualt constructor InformaticsStudent();
+// 2.Copy-constructor InformaticsStudent(const InformaticsStudent& other);
+// 3.operator= InformaticsStudent& operator=(const InformaticsStudent& other);
+// 4.Destructor ~InformaticsStudent()
+// (Най-лесно е като си разпишем функция за копиране CopyFrom и функция за триене Free())
+
+class InformaticsStudent
+{
+private:
+ char* name;
+ int fn;
+
+ void CopyFrom(const InformaticsStudent& other);
+ void Free();
+
+public:
+ /// BIG 4 starts here
+ InformaticsStudent();
+ InformaticsStudent(const InformaticsStudent& other);
+ InformaticsStudent& operator=(const InformaticsStudent& other);
+ ~InformaticsStudent();
+ // BIG 4 ends here
+
+ InformaticsStudent(const char* name, int fn);
+
+ void setName(const char* name);
+ void setFn(int fn);
+ const char* getName() const;
+ int getFn() const;
+
+ void printStudent();
+
+};