I'm trying to solve a balanced parentheses problem, here in my code I'm trying to get 1 from a function is_empty() if top of my stack is empty but then here i am stuck with this ugly error.
int is_Empty()
{
int x=0;
if (top==NULL)
{
x=1;
}
return x;
}
here is how i recive it
if (s1.is_Empty==1)
{
cout<<"matched"<<endl;
}
my error log
bal.cpp:112:20: error: invalid use of member 'int stack::is_Empty()' (did you forget the '&' ?)
if (s1.is_Empty==1)
~~~^~~~~~~~