From 624653ec3923df0314b22d1793e456ca19ccc810 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Thu, 8 Feb 2024 16:10:40 -0800 Subject: OHMYGOD I FIGURED IT OUT --- Inclass 10/PointerExamples.cpp | 21 ++++++++++----------- Inclass 10/program.cpp | 4 ++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Inclass 10/PointerExamples.cpp b/Inclass 10/PointerExamples.cpp index 16de9c3..0511482 100644 --- a/Inclass 10/PointerExamples.cpp +++ b/Inclass 10/PointerExamples.cpp @@ -8,20 +8,19 @@ using std::endl; void Swap(Node* first, Node* second) { - int test = 0; - int test2 = 0; - first->data = test; - second->data = test2; - - - cout << "first node swapped is (correct 16): " << second << " the second node swapped is (correct 24): " << first << endl; + int test; + test = first->data; + first->data = second->data; + second->data = test; + + cout << test << endl; + } -void Standardize_101(Node* thirdNode) +void Standardize_101(Node* newNode) { - /*int stan = 0; - Node* thirdNode = stan; - thirdNode->_data = stan;*/ + newNode->data % 101; + } diff --git a/Inclass 10/program.cpp b/Inclass 10/program.cpp index 59231d5..ce6fc87 100644 --- a/Inclass 10/program.cpp +++ b/Inclass 10/program.cpp @@ -27,8 +27,12 @@ int main() Swap(&newNode, &nextNode); + cout << "first node swapped is: " << newNode.data << " the second node swapped is : " << nextNode.data << endl; + Standardize_101(&newNode); + cout << newNode.data << endl; + Square(&nextNode); return 0; -- cgit v1.2.3