Stacks

////
Last edited on
This doesn't make sense:

1
2
3
4
if ((!error) && isEmpty(s))
    cout<<"\nResult: This expression is not balanced. \n"<<endl;
else
    cout <<"\nResult: This expression is balanced. \n"<<endl;


The expression is not balanced if error is true (too many closing parens)
OR if the stack is NOT empty (too few closing parens).

thanks for the reply works now

Last edited on
Topic archived. No new replies allowed.