diff options
| -rw-r--r-- | Inclass 10/Header.h | 1 | ||||
| -rw-r--r-- | Inclass 10/Node.h | 15 | ||||
| -rw-r--r-- | Inclass 10/PointerExamples.cpp | 28 | ||||
| -rw-r--r-- | Inclass 10/program.cpp | 14 |
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 |