From 5dc32bd7bf9204c4113765f53d84a72ed415b71d Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Thu, 8 Feb 2024 14:12:28 -0800 Subject: files and functions set up --- Inclass 10/Header.h | 1 + Inclass 10/Node.h | 15 ++++++++++++++- Inclass 10/PointerExamples.cpp | 28 ++++++++++++++++++++++++++++ Inclass 10/program.cpp | 14 ++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) 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 +#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 #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 -- cgit v1.2.3