Im trying to write a program in c that adds big numbers with linked list. I used reverse to add the numbers, but i cant get it to reverse again. It should be used several times(
As the question is not very specific with the issue you're are facing, below are some points to be taken care,
In function reverse()
,
return reversed, reversedTail;
will always return reversedTail
.
You are trying to call this function from main()
as
root, head = reverseLinkedList(sum, headSum);
which again head
will get the return values. This is incorrect. Usually you should be using a assignment to one member at a time.