void push(int value) { if (top < size - 1) { stack[++top] = value; } else { cout << "Stack overflow!" << endl; } }