summaryrefslogtreecommitdiff
path: root/4p16.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-08-18 21:02:35 +0200
committerOskar <[email protected]>2024-08-18 21:02:35 +0200
commit19903ae3536255dfa2778846275267605cee9f7e (patch)
tree94f9ecb62c1d02b5c00f4fc9c760ec4ed4a10105 /4p16.cpp
parent3d0a78eaaafff660cd04adf23a6bec1721187abf (diff)
more exercises, one unfinished
Diffstat (limited to '4p16.cpp')
-rw-r--r--4p16.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/4p16.cpp b/4p16.cpp
new file mode 100644
index 0000000..5205446
--- /dev/null
+++ b/4p16.cpp
@@ -0,0 +1,29 @@
+#include <iostream>
+
+/*
+ *
+ * 4.16
+ *
+ * Added a mockup getPtr function to demonstrate
+ */
+
+int *getPtr(int *f) {
+
+ return f;
+}
+
+int main () {
+
+ int f;
+ int *p = nullptr;
+ if ((p = getPtr(&f)) != 0) {
+ std::cout << "not nullptr" << std::endl;
+ }
+
+ int i = 1024;
+ if (i == 1024) {
+ std::cout << "i: 1024" << std::endl;
+ }
+
+ return 0;
+}