#include <iostream>
using namespace std;
#define SIZE 20
int data[SIZE];
int sp = -1;
int push(int);
int pop(void);

int main(void)
{


	for (int i = 0; i<SIZE + 3; i++)
	{
		cout << "Pushing " << i << endl;
		if (push(i) == -1)
			cout << "stack full" << endl;
	}

	for (int i = 0; i<SIZE + 3; i++)
	{
		cout << "Popping " << pop() << endl;
	}


	/*should output SIZE lines onto the console window showing array content*/
	return 0;
}

int push(int item)
{
	if (sp < SIZE - 1)
	{
		sp++;
		data[sp] = item;
		return 0;
	}
	else
		return -1;
}

int pop(void)
{
	int temp;
	if (sp>-1)
	{
		temp = data[sp];
		sp--;
		return temp;
	}
	else
		return -1;
}
