Using stack and arithmetic tree

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Feelings
Earned a small fee
Earned a small fee
Posts: 16
Joined: Sun Jun 28, 2020 11:17 am

Using stack and arithmetic tree

Post by Feelings » Fri Jul 10, 2020 5:36 pm

Hi everyone. I am now coding a calculator app but it work only for two numbers.. I mean a+b or a*b. I wondering modify this app it would be possible to calculate on many numbers and create order of operations and maybe it would be good to use stack to contain numbers and then use arithemtic tree?

Kvaz1r
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 216
Joined: Tue Jun 07, 2016 1:07 pm

Re: Using stack and arithmetic tree

Post by Kvaz1r » Fri Jul 10, 2020 7:35 pm

Yes you can use tree to create calculator. There are tons of article about creating and evaluating expression tree.
Or you can use some library and not to do all work by yourself.

Post Reply