Converting from Infix to Postfix and evaluating Postfix notation
问题 I'm writing a program that reads an Infix notation, converts it to Postfix and then evaluate that Postfix. Here's my program: #include<stdio.h> #include <ctype.h> #define SIZE 50 /* Size of Stack */ char s[SIZE]; int top = -1; /* Global declarations */ push(char elem) { /* Function for PUSH operation */ s[++top] = elem; } char pop() { /* Function for POP operation */ return (s[top--]); } int pr(char elem) { /* Function for precedence */ switch (elem) { case '#': return 0; case '(': return 1;