I'm having trouble trying to understand a practice question.
The program is suppose to do a arithmetic calculation no matter how long an integer is.
So firstly i do it by allowing user to input a string and i store them in a dynamic memory storage. I then add to the tail in order to reverse the string to do my calculation.
This is how i added my string into the tail of each node
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
NodePtr temp = new Node;
temp -> data = str1;
temp -> next = NULL;
if(head == NULL)
head = temp;
else
{
NodePtr curr = head;
while(curr -> next != NULL)
curr = curr -> next;
curr -> next = temp;
}
However the question is, how do i even transfer the character array that i stored in the nodes as linkedlist be taken out and transfered as an integer array before doing the arithmetic calculation?