aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-02-08 14:12:28 -0800
committerConnor McDowell <[email protected]>2024-02-08 14:12:28 -0800
commit5dc32bd7bf9204c4113765f53d84a72ed415b71d (patch)
tree4c7424cf2d8d5f58fac8ce025079c451901ea1fc
parentprogram.cpp and header.h set up (diff)
downloadin-class-exercise-10-connormcdowell275-5dc32bd7bf9204c4113765f53d84a72ed415b71d.tar.xz
in-class-exercise-10-connormcdowell275-5dc32bd7bf9204c4113765f53d84a72ed415b71d.zip
files and functions set up
-rw-r--r--Inclass 10/Header.h1
-rw-r--r--Inclass 10/Node.h15
-rw-r--r--Inclass 10/PointerExamples.cpp28
-rw-r--r--Inclass 10/program.cpp14
4 files changed, 57 insertions, 1 deletions
diff --git a/Inclass 10/Header.h b/Inclass 10/Header.h
index edfa1e2..b88a0a0 100644
--- a/Inclass 10/Header.h
+++ b/Inclass 10/Header.h
@@ -1,5 +1,6 @@
#ifndef HEADER
#define HEADER
+#include "Node.h"
void Swap(Node* first, Node* second);
diff --git a/Inclass 10/Node.h b/Inclass 10/Node.h
index 6f70f09..8c11984 100644
--- a/Inclass 10/Node.h
+++ b/Inclass 10/Node.h
@@ -1 +1,14 @@
-#pragma once
+#ifndef NODE_HEADER
+#define NODE_HEADER
+#include "Header.h"
+
+
+struct Node
+{
+ int _data;
+ Node* next;
+};
+
+
+
+#endif NODE_HEADER
diff --git a/Inclass 10/PointerExamples.cpp b/Inclass 10/PointerExamples.cpp
index e69de29..4889659 100644
--- a/Inclass 10/PointerExamples.cpp
+++ b/Inclass 10/PointerExamples.cpp
@@ -0,0 +1,28 @@
+#include <iostream>
+#include "Header.h"
+#include "Node.h"
+
+using std::cin;
+using std::cout;
+using std::endl;
+
+void Swap(Node* first, Node* second)
+{
+
+
+
+}
+
+void Standardize_101(Node* node)
+{
+
+
+
+}
+
+void Square(Node* node)
+{
+
+
+
+} \ No newline at end of file
diff --git a/Inclass 10/program.cpp b/Inclass 10/program.cpp
index 3cbe4b4..d3f8005 100644
--- a/Inclass 10/program.cpp
+++ b/Inclass 10/program.cpp
@@ -5,6 +5,7 @@
#include <iostream>
#include "Header.h"
+#include "Node.h"
using std::cin;
using std::cout;
@@ -12,7 +13,20 @@ using std::endl;
int main()
{
+ Node firstNode{};
+ Node secondNode{};
+ Node thirdNode{};
+ firstNode._data = 24;
+ secondNode._data = 16;
+ thirdNode._data = 4;
+
+
+ Swap(&firstNode, &secondNode);
+
+ Standardize_101(&thirdNode);
+
+ Square(&thirdNode);
return 0;
} \ No newline at end of file