cpp:stl:intro
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cpp:stl:intro [2023/05/29 16:15] – [Η κλάση Student] gthanos | cpp:stl:intro [2023/05/30 18:30] (current) – [Η κλάση Student] gthanos | ||
---|---|---|---|
Line 16: | Line 16: | ||
class Student { | class Student { | ||
- | public: | + | private: |
char *name; | char *name; | ||
int aem; | int aem; | ||
+ | public: | ||
Student(); | Student(); | ||
Student(const char *name, int aem); | Student(const char *name, int aem); | ||
Student(const Student& | Student(const Student& | ||
~Student(); | ~Student(); | ||
+ | | ||
+ | char* getName() const; | ||
+ | int getAEM() const; | ||
+ | void setName(char*); | ||
+ | void setAEM(int); | ||
+ | | ||
friend std:: | friend std:: | ||
bool operator> | bool operator> | ||
+ | bool operator< | ||
Student& | Student& | ||
}; | }; | ||
Line 53: | Line 60: | ||
delete []name; | delete []name; | ||
} | } | ||
+ | } | ||
+ | |||
+ | char* Student:: | ||
+ | return name; | ||
+ | } | ||
+ | |||
+ | int Student:: | ||
+ | return aem; | ||
+ | } | ||
+ | |||
+ | void Student:: | ||
+ | this-> | ||
+ | delete this-> | ||
+ | this-> | ||
+ | strcpy(this-> | ||
+ | } | ||
+ | |||
+ | void Student:: | ||
+ | this-> | ||
} | } | ||
Line 73: | Line 99: | ||
bool Student:: | bool Student:: | ||
if(aem > st.aem) | if(aem > st.aem) | ||
+ | return true; | ||
+ | return false; | ||
+ | } | ||
+ | |||
+ | bool Student:: | ||
+ | if(aem < st.aem) | ||
return true; | return true; | ||
return false; | return false; |
cpp/stl/intro.1685376936.txt.gz · Last modified: 2023/05/29 16:15 by gthanos