Stacks and Queues 161
printf (“\n Enter the size of the infix expression”);
scanf (“%d”, &size); size--;
printf (“\n Enter the terms of infix expression one by one”);
for (i= 0; i <= size; i++)
{fflush(stdin); /* flush the input buffer */
scanf (“%c”, &infix[i]);
}
pos = 0; /* position in target expression */
for (i=0; i <= size; i++)
{
res = match(opTab, infix[i], &op);
/* find whether operator/operand */
if (res==0)
{target[pos] = infix[i]; /* store into target expression */
pos++;
}
else
{if (top < 0)
push (stack, &top, op, size); /* first time Push ...