Originally Posted by
Junky
I was the one to advise you in your other post.
Search the web for info about postfix. You should find a algorithm to do it. Why should you change to postfix? Because it makes evaluation so much easier. 1 + 2 * 3 becomes 1 2 3 * +. Then you read the postfix expression. Each time you read an operand you push it onto a Stack. Each time you read an operator you pop 2 values off the Stack, perform operation and push result back onto Stack.
Read 1
Push onto Stack
Read 2
Push onto Stack
Read 3
Push onto Stack
Read *
Pop 3
Pop 2
Multiply
Push 6 onto Stack
Read +
Pop 6
Pop 1
Add
Push 7 onto Stack
Now you have finished reading the postfix expression and the result is the only value left on the Stack: 7.
If this is too much for you then I suggest attempting something simpler.