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: 21
Joined: Sun Jun 28, 2020 11:17 am

Using stack and arithmetic tree

Post by Feelings »

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
Super wx Problem Solver
Super wx Problem Solver
Posts: 357
Joined: Tue Jun 07, 2016 1:07 pm

Re: Using stack and arithmetic tree

Post by Kvaz1r »

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