Are you guys allowed to use parsers? Bison and Flex are really well suited to this, and it's pretty simple to implement bodmas/pedmas with it as well, and the user can input everything all in one line.
Although this does mean you have to learn language grammar / BNF / LR parsing, but if you're up for the challenge, you can solve this problem in wayyy fewer lines of code, and get a really good quality program.
EDIT: Just saw the date of this post, dang the cpp community isn't in the best shape here.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Are you guys allowed to use parsers? Bison and Flex are really well suited to this, and it's pretty simple to implement bodmas/pedmas with it as well, and the user can input everything all in one line.
Although this does mean you have to learn language grammar / BNF / LR parsing, but if you're up for the challenge, you can solve this problem in wayyy fewer lines of code, and get a really good quality program.
EDIT: Just saw the date of this post, dang the cpp community isn't in the best shape here.