summaryrefslogtreecommitdiff
path: root/3p7.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3p7.cpp')
-rw-r--r--3p7.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/3p7.cpp b/3p7.cpp
new file mode 100644
index 0000000..9acc8fb
--- /dev/null
+++ b/3p7.cpp
@@ -0,0 +1,30 @@
+#include <iostream>
+#include "sales_data.hpp"
+#include "sales_item.hpp"
+
+/*
+ *
+ * 3.7
+ *
+ * Nothing different happens, pretty much same result. Though auto might just be better so we are sure what type it is.
+ * Unless the author meant that we were supposed to do char rather than (char&). If we were to just do 'char' type then
+ * we wouln't be able to modify the characters in the string, therefore the string remains unchanged.
+ */
+
+using std::string;
+using std::cout;
+using std::cin;
+using std::cerr;
+using std::clog;
+using std::endl;
+int main () {
+
+ string Xer;
+ cout << "Enter a string" << endl;
+ cin >> Xer;
+ for(char &c : Xer) { // Make reference for every character in Xer
+ c = 'X';
+ }
+ cout << Xer << endl;
+ return 0;
+}