int main()
{
string str;
cout << "Enter Infix Expression \n";
cin >> str;
cout << "infix:" << str << "\n";
string postfix = InfixToPostfix(str); // **error cause here**
cout << "postfix: " << postfix << "\n\n";
system("pause");
return 0;
}
// Function to evaluate Postfix expression and return output
template <class T>
string InfixToPostfix(string& str)
{
Stack<char> *charStackPtr;
charStackPtr = new Stack<char>();
string postfix = ""; // Initialize postfix as empty string.
for (int i = 0; i< str.length(); …
Run Code Online (Sandbox Code Playgroud)