I don't know with out seeing your whole code. You've made some changes (notably adding an index field), so I'm not sure you're building your list with correct index values. Run through your code in...
Type: Posts; User: anduril462
I don't know with out seeing your whole code. You've made some changes (notably adding an index field), so I'm not sure you're building your list with correct index values. Run through your code in...
Oh, okay. Well, I still recommend ditching your 'current' variable. Just ask for the input 3 times:
do {
print "Enter a command: "
read line
add digits to first_num
print...
Your storeNum and printList look great. A few small things to clear up first:
Here's what happens when I compile your program:
$ gcc -Wall -g -std=c99 list.c -o list
list.c: In function...
I think if there is a carry left over at the end, you have to allocate another new_item_ptr and insert that at the head of the list.
The reason result is pointing to the same place is because that's what you told it to do. I'm not sure what you expect to happen, so I can't really offer a solution. I can say, however, that there...