You are pushing single digits / characters on the stack. When a number is greater than 9 you will push multiple digits that must be all popped and converted to a number.
It all depends on how the input is formatted. Assuming something like "num1 num2 op", I suggest to write functions to push and pop numbers:
int pushdigit(const char* input, int pos, stack *s)
{
while (istdigit(input[pos])
{
s->push(input[pos++]);
}
s->push(0);
return (' ' == input[pos]) ? pos + 1 : pos;
}
int popdigit(stack *s)
{
int num = 0;
int mult = 1;
while (!s->isempty())
{
char c = s->pop();
if (!isdigit(c))
break;
num += mult * (c - '0');
mult *= 10;
}
return num;
}