Does pop function really removes the item from the array, it just changes the pointing index?
int STACK::pop()
{
int temp;
if(isEmpty())
return -9999;
temp=num[top];
--top;
return temp;
}
No, the element isn't removed from the array. It isn't possible to add or remove elements of an array. Arrays have constant number of elements through their lifetime.