Working on assignment. Finally.

This week I realized i was actually really behind on my assignments, therefore i will be working on them fully from now on since we’re done with the group reports.

Today i got up early (normally) and went down to the Game room to work before lunch. Working down there let me make some actual progress in my LinkedList assignment.
The issues i had been having was related to setting up the structure for generic programming when using a separate header file. I was trying to make it work with a new class which had a header file and a .cpp file. However i learned that .cpp files and the template class don’t mix. Now i’m doing the functionality in the LinkedList.h file and am almost done with the push_front function. There is only one more issue i need to solve.

When running the code to add a number of variables from another array(as part of the setup for the list) the current code makes the previous node’s value set to the new value as well. I will solve it and post the revised section of code.

// if (pv_nodes.size() > 1)
{
node

tempNode = newNode;
tempNode.next = &newNode;
pv_nodes[numbr -1] = tempNode;
}

Revised: It was actually just a very minor error.
The line folowing line had an error in it:

// pv_nodes[numbr -1] = tempNode;

The variable “numbr” is the value from a previous for loop which goes through the initial array. It is used in this to keep track of what part of the array pv_nodes the number should be added to. I had forgotten to account for how i use the variable inputted into the list differently because of the separate node pn_first.

While writing this i also realized that i had been writing a push_back function rather than a push_front. Luckly i can just rename it when i’m done and do the push_front properly. Good thing i noticed before anyone saw.