From 40f7cc8f54d0c221a391457fd38a44d0633aa088 Mon Sep 17 00:00:00 2001 From: angeld55 Date: Mon, 16 May 2022 14:05:08 +0300 Subject: fixed typo in folder name --- Utills/BigFour.cpp | 89 ------------------------------------------------------ 1 file changed, 89 deletions(-) delete mode 100644 Utills/BigFour.cpp (limited to 'Utills/BigFour.cpp') 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 -#include - -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; -} - -- cgit v1.3.1-23-gd82d