I am creating a linked list and I am confused about how to operator overload the addition of a linked list. this is my .cpp file and the portion im confused about is how to make the addition operator.
If this is a singly-linked list, I might be able to help. For future reference, include the class definition (in this case LargeInt), so it is easy to see. If it is any other kind (doubly-linked, circular...etc.), it may not work or be the most efficient, so disregard the following...
You will have to move through the list you already have, by testing if the next pointer is NULL. When it is you create a new node with the value of the first node in the LargeInt &addition you passed in. Create a pointer (ex. LargeInt* ptr) to track the values of addition->next. While that pointer (ex. ptr->next) is not equal to NULL, continue creating new nodes with ptr->data as the data in your nodes.
Link lists can be tricky, and seg faults are easily made. Drawing pictures is incredibly helpful with them. I am probably not right about how you would do this exactly, as I am not sure how your nodes are set up, but the concept is there. You may need additional pointers to track, but you'll have to figure that out yourself.
One more key thing: when you create a node, make sure its next pointer value = NULL, so that when you break out of your loop, the last pointer will have NULL set.