If you do change it to void, you'll have to change all those places where you really did return something useful.
Just to keep from getting "bus error" I needed to malloc room for Returnoperation to do its thing inside performoperation.
And even though you said you needed to clear out and move forward (or at least move forward!) after writing an answer back to evaluation, as you can see by the following trace (where I'm printing out equation and original_evaluation each time through):
Edit: Oh, and once you get that fixed you will still have to deal with the whole backwards-off-the-list-thing. Right now, you have a filloperand call after that loop finishes -- but if you actually only backed into a space, well, that will multiply by 10 and subtract 16, which isn't what you want.Code:./postfix
At top of loop: 1 2 + 4 5 + * and xxxxxxxxx
At top of loop: 2 + 4 5 + * and 1 xxxxxxx
At top of loop: 2 + 4 5 + * and 1 xxxxxxx
At top of loop: + 4 5 + * and 1 2 xxxxx
At top of loop: + 4 5 + * and 1 2 xxxxx
op2 is 2 and evaluation is now 2 xxxxx.
op1 is 1 and evaluation is now 1 2 xxxxx.
writeoperation is 3 .
At top of loop: 4 5 + * and 3 2 xxxxx
At top of loop: 4 5 + * and 3 2 xxxxx
At top of loop: 5 + * and 4 2 xxxxx
At top of loop: 5 + * and 4 2 xxxxx
At top of loop: + * and 4 5 xxxxx
At top of loop: + * and 4 5 xxxxx
op2 is 5 and evaluation is now 5 xxxxx.
op1 is 4 and evaluation is now 4 5 xxxxx.
writeoperation is 9 .
At top of loop: * and 9 5 xxxxx
At top of loop: * and 9 5 xxxxx
op2 is -112 and evaluation is now .
op1 is -48 and evaluation is now .
writeoperation is 5376 .
5 xxxxx

