summaryrefslogtreecommitdiff
path: root/3p11.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-08-06 18:48:35 +0200
committerOskar <[email protected]>2024-08-06 18:48:35 +0200
commitcb72c34ff23c8c6c2e6b8376d1cf8a5ca5b9becb (patch)
tree39daeb9ac24d58cff4580cd879423d97b9158417 /3p11.cpp
parent4483699cc8cc937cb27040cfbd809b8a90029391 (diff)
more exercises
Diffstat (limited to '3p11.cpp')
-rw-r--r--3p11.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/3p11.cpp b/3p11.cpp
new file mode 100644
index 0000000..f2fb9cf
--- /dev/null
+++ b/3p11.cpp
@@ -0,0 +1,29 @@
+#include <iostream>
+#include "sales_data.hpp"
+#include "sales_item.hpp"
+
+/*
+ *
+ * 3.11
+ *
+ * Yes, its legal. We aren't trying to do any write operations to the string.
+ * The type for c is const char&
+ * Also known as a reference to const char
+ */
+
+using std::string;
+using std::cout;
+using std::cin;
+using std::cerr;
+using std::clog;
+using std::endl;
+int main () {
+
+ const string s = "Keep out!";
+ for (auto &c : s) {
+ /* ... */
+ cout << c; // I put this cout here so it compiles with the flags i have enabled.
+ }
+
+ return 0;
+}