I have an assignment in my Data Structures class in which I have to program a calculator that solves arithmetic expressions with the 4 basic operations and parenthesis, the inpu
That is the problem called "unary minus" and can in your case (no variables) get solved by substitution.
The operator -
is an unary minus if it is
Now instead of storing a -
you store a different character like, say m
and assign it a higher precedence than the other operators (or the same as the exponentiation operator if you have one).
Another tip: don't use spaces to indicate anything, an arithmetic expression must work without any spaces or it is not correct.