summaryrefslogtreecommitdiff
path: root/3p31.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-08-11 20:59:53 +0200
committerOskar <[email protected]>2024-08-11 20:59:53 +0200
commit06615448f1fd8378817e8ef72b5347ae3f0c3577 (patch)
treefc89a7edaee13953211d006a9c1a428dd279247c /3p31.cpp
parentb45c0d29ee690c8b436a33581d3b108e6064b5a7 (diff)
more
Diffstat (limited to '3p31.cpp')
-rw-r--r--3p31.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/3p31.cpp b/3p31.cpp
new file mode 100644
index 0000000..0e7970b
--- /dev/null
+++ b/3p31.cpp
@@ -0,0 +1,40 @@
+#include <iostream>
+#include <vector>
+#include "sales_data.hpp"
+#include "sales_item.hpp"
+
+/*
+ *
+ * 3.31
+ *
+ * I mean this was really easy because i just remembered what
+ * i'd already seen in the last exercise...
+ * I made one more like the one in the book and one that's
+ * a little bit more simpler. Not sure how 'correct' the simpler
+ * version is. Who knows...
+ */
+
+int main () {
+
+ constexpr size_t ArraySize = 10;
+ int MyArray[ArraySize];
+ for(size_t Index = 0 ; Index != ArraySize ; ++Index) {
+ MyArray[Index] = Index;
+ }
+
+ int MyArray2[10];
+ for(int Index = 0 ; Index != 10 ; ++Index) {
+ MyArray2[Index] = Index;
+ }
+
+ for(auto i : MyArray) {
+ std::cout << i << std::endl;
+ }
+
+ std::cout << std::endl;
+ for(auto i : MyArray2) {
+ std::cout << i << std::endl;
+ }
+
+ return 0;
+}