I have a header with inline implementation and I have a node header that returns all the values I need. I know my node header is correct, but when I run my program I am getting a runtime error in my push_back function. This function is supposed to be adding a node to the end of the list. Could anyone tell me what I am doing wrong?
What is node::str()? Your push_back method doesn't look right at all. You need to traverse until your pointer (current position) node has a next pointer of null, signalling it's the last in line. Then create a new node, and set the current.next = newNode.
EDIT:
node::str is your data. Anyways, you're also setting previous_ptr to null, then trying to dereference it. That's a pretty big issue. Definitely rework your logic here.
Okay, tell me if this sounds right. If I have a head and tail pointer and I test them and they are equal to NULL then I can just add the node else I can iterate through the node till I get to tail->NULL and add the node there?