From 8c40c473ab5698ad7e510fe742d46a0e641e6cd8 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Sat, 10 Feb 2024 11:16:34 -0800 Subject: there was an incorrectness, newNode and nextNode's swap did not persist after the function ended --- Inclass 10/program.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Inclass 10/program.cpp') diff --git a/Inclass 10/program.cpp b/Inclass 10/program.cpp index fb9b9c6..e591996 100644 --- a/Inclass 10/program.cpp +++ b/Inclass 10/program.cpp @@ -25,6 +25,8 @@ int main() newNode.next = &nextNode; + cout << nextNode.data << endl; + Swap(&newNode, &nextNode); cout << "first node swapped is: " << newNode.data << " the second node swapped is : " << nextNode.data << endl; -- cgit v1.2.3