consolidate all repos to one for archive
This commit is contained in:
26
semester_2/programiranje_2/naloga0902/Date.h
Normal file
26
semester_2/programiranje_2/naloga0902/Date.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef NALOGA0201_DATE_H
|
||||
#define NALOGA0201_DATE_H
|
||||
|
||||
#include <string>
|
||||
class Date {
|
||||
friend std::ostream& operator<<(std::ostream &out, const Date &date);
|
||||
private:
|
||||
unsigned int day, month, year;
|
||||
int months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
public:
|
||||
Date() = default;
|
||||
|
||||
Date(unsigned int day, unsigned int month, unsigned int year);
|
||||
|
||||
~Date() = default;
|
||||
|
||||
std::string toString() const;
|
||||
|
||||
bool operator==(const Date& other) const;
|
||||
|
||||
Date& operator++();//prefix ++a
|
||||
|
||||
Date operator++(int dummy);//postfix a++
|
||||
};
|
||||
|
||||
#endif //NALOGA0201_DATE_H
|
||||
Reference in New Issue
Block a user