Hi guys so I've come across a snag when trying to get my code working for a calculator using tokens anyway in the book Bjarne helps you and gives you the code for the primary() term() and expression() but he leaves out the getToken() function so I tried to implement this myself
after working on this with a piece of paper for 2 hours I can't seem to get the code working on paper it should work but when I run the program all it prints is the first number I entered in
for example
enter an expression
4 + 2 + 2 q // input
4 // output
enter an expression
error
5.18496e+006
but for my own sanity how would I get my code to work AKA write my own getToken() function,I mean I populate the vector of Tokens with the populateTokens() function then I use the getToken() function to get the next Token in the vector,
any ideas how I can tweak my code to make it work,or at least so it calculates the sum (doesn't have to be in the correct order just want to get it working)