Hi Everyone,
I'm having a problem with displaying an error for my postfix calculator. If an input were to be something like:
1.2.3 +
Then it should cerr that it is an invalid expression. But I'm having trouble with the code that would determine if it was an error. All of my functions work and the rest of the calculator works as well. It's just this minor detail that I can't figure out. What I have for this part so far is:
Is there a way to just check the digit and output an error if it has more than one decimal and isn't separated by a space? I'm having trouble understanding why I would need to use char for anything other than my operators.
I am not sure how your program works. One way would be to read thow whole input into a string with getline. The you can iterate through the whole string and check if it contains any invalid input.
Maybe you also can tell us what valid input is.