konstruktory
Tomek: Klasa daty, która pobiera datę, dodaje dni i wyświetla nową datę w C++. Nie proszę o kod,
proszę o wskazówki. Dziękuje.
17 paź 00:44
Dziadek Mróz:
Coś na kształt DateTime w C#:
Time:
Second
Minute
Hour
Time() → czas systemowy
Time(second, minute, hour) Second = second, ...
second() return Second
minute() return Minute
hour() return Hour
friend std::ostream &operator <<(std::ostream &os, const Time &t)
format(const char *frm) → wyświetlenie czasu w danym formacie %s, %ss, %m, %mm, ...
Time &operator +(const Time &t1, const Time &t2)
Time &operator −(const Time &t1, const Time &t2)
Time &operator +(int seconds, const Time &t)
Time &operator −(int seconds, const Time &t)
Date:
Day
Month
Year
Date() → data systemowa
Date(day, month, year) Day = day, ...
day() return Day
month() return Month
year() return Year
friend std::ostream &operator <<(std::ostream &os, const Date &d)
format(const char *frm) → wyświetlenie daty w danym formacie %s, %ss, %m, %mm, ...
Date &operator +(const Date &d1, const Date &d2)
Date &operator −(const Date &d1, const Date &d2)
Date &operator +(int seconds, const Date &d)
Date &operator −(int seconds, const Date &d)
DateTime(Time, Date): → dziedziczenie po Time i Date
DateTime() → Time(), Date()
DateTime(second, minute, hour) → Time(second, minute, hour)
DateTime(second, minute, hour, day, month, year) → Time(second, ...), Date(day, ...)
friend std::ostream &operator <<(std::ostream &os, const DateTime &dt)
format(const char *frm) → wyświetlenie daty w danym formacie %s, %ss, %m, %mm, ...
DateTime &operator +(const DateTime &dt1, const DateTime &dt2)
DateTime &operator −(const DateTime &dt1, const DateTime &dt2)
DateTime &operator +(int seconds, const DateTime &dt)
DateTime &operator −(int seconds, const DateTime &dt)
Niezbyt skomplikowany projekt ale zabawy co niemiara ;)
17 paź 15:52