C++ how to isdigit() a negative number?

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

isdigit() is doing what it is supposed to do. It filters out the character stream into digits and non-digits. So the minus will be discarded as not being a digit. Change the code so that it skips over the sign and after reading in the digit prepend the sign to it.