This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
cpp:stl:intro [2023/05/30 11:02] gthanos [Η κλάση Student] |
cpp:stl:intro [2023/05/30 18:30] (current) gthanos [Η κλάση Student] |
||
---|---|---|---|
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> | ||
Line 54: | 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-> | ||
} | } | ||