The problem a string literal value is constant and the function is not set up for that. Here is how you can fix it :
int InfixToPostfix( const char expression[] ){
const char *e;
Stack<char> stack(10);
e=expression;
while(*e!='\0'){
if ((*e >= 'a' && *e <= 'z') || (*e >= 'A' && *e <= 'Z')
|| (*e >= '0' && *e <= '9'))
cout<<*e;
else if (*e=='(')
stack.Push(*e);
else if (*e==')'){
while ((x=stack.Pop())!='(')
cout<<"x";
}
else{
while(Priority(stack.Top())>= Priority(*e))
cout<<stack.Pop();
stack.Push(*e);
}
}
e++;
while (!stack.IsEmpty()){
cout<<stack.Pop();
}
}
It basically amounts to making the function take a
const char
pointer.