summaryrefslogtreecommitdiff
path: root/7p42.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-09-30 19:31:02 +0200
committerOskar <[email protected]>2024-09-30 19:31:02 +0200
commite0ffab6b379851aa573d7009fcf50e1be892f734 (patch)
tree7d725f15a645492f1b7dfc9c22c3f44cf83bb888 /7p42.cpp
parentc2d59bb8a75c6228a91393b9cf3aedcb4d455218 (diff)
more
Diffstat (limited to '7p42.cpp')
-rw-r--r--7p42.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/7p42.cpp b/7p42.cpp
new file mode 100644
index 0000000..6f71c6a
--- /dev/null
+++ b/7p42.cpp
@@ -0,0 +1,41 @@
+#include <iostream>
+
+/*
+ *
+ * 7.40
+ *
+ *
+ */
+
+class Date {
+public:
+ Date(time_t et, time_t et_c): epochtime(et), epochcompare(et_c) {}
+ Date(): Date(0, 0) { std::cout << "delegated\n"; }
+ Date(time_t et): Date(et, 0) { std::cout << "delegated\n"; }
+ std::ostream& printepoch(std::ostream& pecout) {
+ pecout << epochtime;
+ return pecout;
+ }
+ time_t getepoch() { return epochtime; }
+ time_t getcompare() { return epochcompare; }
+ std::string& getformatted() {
+ formatted = "TEST"; // Just an example, we format the time here.
+ return formatted;
+ }
+
+private:
+ time_t epochtime;
+ time_t epochcompare;
+ std::string formatted;
+};
+
+int main () {
+
+ Date d1;
+ Date d2(342342423);
+ d1.printepoch(std::cout) << std::endl;
+ d2.printepoch(std::cout) << std::endl;
+ std::cout << d1.getepoch() << std::endl;
+ std::cout << d1.getformatted() << std::endl;
+ return 0;
+}