DEV Community

Discussion on: School project

Collapse
 
gavinfernandes2012 profile image
Gavin Fernandes • Edited

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.