You can't assign a value to pos. pos can't equal a digit or a char. pos is a constant address to the char array named (tada!) pos.
I believe you meant to use pos[i], everywhere you assign or check the value of pos. .
I can't see why your compiler isn't giving you warnings and errors. Do you have your alerts shut off or turned way down?
Anyway, welcome to the forum, and please highlight your code in the future, and click on the # icon near the smilies selector, at the top of the post reply (full) window. That will put your code into the forum as a program, rather than just plain text, and make it look much better.
Originally Posted by Prateekr10
I have a large program running atm and can't run your program, yet. Have no idea if it works or not.
#define MAX 50
void push(float a)
int main() //not void main()
float a, b, c,p;
int i=0, j=0;
printf("\n Enter the postfix expression");
while(pos!='\0') //should be pos[i]
if(isdigit(pos)) //again pos[i]
p = (float)pos - 48; //(pos[i] - 48)
else if( (pos=='*') || (pos=='/') || (pos=='-') || (pos=='+')) //all pos[i]
a = pop();
b = pop();
c = b+a;
c = b-a;
c = b*a;
c = b/a;
printf("\n Enter only digits and 4 operators");
printf("\n The value of the postfix expression is = %f",stack); //thank JacobN for this correction