Get Token assembly example
This function accepts any string, and returns tokens that are either:
- Arithmetic operators (+,-,*,/), returned as their negative
- Integers
- End of string (returns -1)
As the argument, you must pass the address of your string pointer, as getToken
must consume input for successive calls.
(see the testing program.)
Source files:
To run the test, pass one string on the command line. If there are spaces, put it in quotes.