Closed pramay88 closed 2 weeks ago
In your isfull() function, the condition for full stack is top == capacity, but the maximum index for an array in C++ is capacity - 1, so the condition should be top == capacity - 1.
In your isfull() function, the condition for full stack is top == capacity, but the maximum index for an array in C++ is capacity - 1, so the condition should be top == capacity - 1.