consolidate all repos to one for archive
This commit is contained in:
32
semester_2/programiranje_2/primeri/Example12/Date.h
Normal file
32
semester_2/programiranje_2/primeri/Example12/Date.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef EXAMPLE12_DATE_H
|
||||
#define EXAMPLE12_DATE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
class Date {
|
||||
private:
|
||||
int day;
|
||||
int month;
|
||||
int year;
|
||||
public:
|
||||
Date();
|
||||
// Date(const Date& date);
|
||||
Date(int d, int m, int l);
|
||||
virtual ~Date();
|
||||
|
||||
int getDay() const;
|
||||
void setDay(int day);
|
||||
int getMonth() const;
|
||||
void setMonth(int month);
|
||||
int getYear() const;
|
||||
void setYear(int year);
|
||||
|
||||
// A std::string is a class which defines objects that be represented as stream of characters.
|
||||
// Size of the character array has to allocated statically, more memory cannot be allocated
|
||||
// at run time if required. Unused allocated memory is wasted in case of character array.
|
||||
// In case of strings, memory is allocated dynamically. More memory can be allocated at run time
|
||||
// on demand. As no memory is preallocated, no memory is wasted.
|
||||
const std::string toString() const;
|
||||
bool isEqual(const Date& date) const;
|
||||
};
|
||||
#endif //EXAMPLE12_DATE_H
|
||||
Reference in New Issue
Block a user