Website Summary Files Commits Branches @commit @diff @stats
path: root / Utills / BigFour.cpp
diff options
context:
space:
mode:
Commit40f7cc8f54d0c221a391457fd38a44d0633aa088 (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2022-05-16 14:05:08 +0300
Committer
 angeld55 <angel_dimitriev@abv.bg>
2022-05-16 14:05:08 +0300
Files29fecbef2da1e832f3f8e9e23db6fffe35d7ddc6 /Utills/BigFour.cpp
Object-oriented_programming_FMI-40f7cc8f54d0c221a391457fd38a44d0633aa088.tar
Object-oriented_programming_FMI-40f7cc8f54d0c221a391457fd38a44d0633aa088.tar.gz
Object-oriented_programming_FMI-40f7cc8f54d0c221a391457fd38a44d0633aa088.zip
Parentde7b4d3f7ac3ecd42ca336b0d477712a462d27ee (diff)
fixed typo in folder name
1 files changed, 0 insertions, 89 deletions
-rw-r--r--Utills/BigFour.cpp89
diff --git a/Utills/BigFour.cpp b/Utills/BigFour.cpp
deleted file mode 100644
index 383440d..0000000
--- a/Utills/BigFour.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-
-#include <iostream>
-#include <cstring>
-
-using namespace std;
-
-class Student
-{
- char* name;
- int* grades;
- size_t gradesSize;
-
- void free()
- {
- delete[] name, grades;
- }
-
- void copyFrom(const Student& other)
- {
- setName(other.name);
- setGrades(other.grades);
- }
-
- public:
-
- Student() : name(nullptr), grades(nullptr) {}
-
- Student(const Student& other)
- {
- copyFrom(other);
- }
-
- Student& operator=(const Student& other)
- {
- if (this != &other)
- {
- free();
- copyFrom(other);
- }
- return *this;
- }
-
- ~Student()
- {
- free();
- }
-
- const char* getName() const
- {
- return name;
- }
-
- const int* getGrades() const
- {
- return grades;
- }
-
- void setName(const char* givenName)
- {
- if(givenName == nullptr || givenName == name)
- return;
- delete[] name;
- name = new char[strlen(givenName) + 1];
- strcpy(name, givenName);
- }
-
- void setGrades(const int* givenGrades, size_t size)
- {
- if(givenGrades == nullptr || givenGrades == grades)
- return;
-
- delete[] grades;
-
- grades = new int[size];
- for(size_t i = 0; i< size; i++)
- grades[i] = givenGrades[i];
- gradesSize = size;
- }
-
-
-};
-
-int main()
-{
-
-
- return 0;
-}
-