empty() and ful() functions in stack class

given the definition of empty()
1
2
3
4
bool Stack::empty() const
{
  return (myTop == -1);
}


would I be wrong to assume that the full() function would simply be...
1
2
3
4
bool Stack::full() const
{
  return (myTop == 128);
}


or is that not how it works? lol
what if myTop > 128. And both of "empty" and "full" is too simple I think.
Last edited on
I thought myTop couldnt be > 128 because 128 is the stack capacity :S
Topic archived. No new replies allowed.