hi people,
I have a function which I am passing a stream which is basically postfix notation
if(isdigit(in.peek()))
{
in >> number;
nums.push(number);
}
else if (strchr("+-*/", in.peek( )) != NULL)
{
in >> symbol;
do_operation(symbol, nums, okay);
}
else
{
in.ignore();
}
the stream I am passing would look like this:
2 -3 +
which is effectivley 2 + -3
the problem is that isdigit(in.peek()) is reading the '-' as a char and not part of the negative number..... what can I do?
Cheers in advance