#include <stack>
#include <iostream>
using namespace std;
typedef struct {
	int x;
	int y;
} position;
std::stack<position> dfsStack;   
int main(void) {
	position current;  //initialise current position
	current.x = 0;
	current.y = 0;
	position startPosition;   //initialise start position
	startPosition.x = 1;
	startPosition.y = 2;
	dfsStack.push(startPosition);  //dfs initialise stack with start position
	for (int i = 0; i < 5; i++)  //push a shed load of positions onto rthis stack to test it.
	{								// not part of the dfs algorithm!!!!!!!!!!!!!!
		for (int j = 0; j < 5; j++) {
			current.x = i;
			current.y = j;
			dfsStack.push(current);
			cout << "pushing" << endl;
		}
	}
	//empties stack
	while (!dfsStack.empty()) {
		current = dfsStack.top();  //top plus pop equals a stack pop operation
		dfsStack.pop();
		cout << "Popping (" << current.x << "," << current.y << ")" << endl;
	}
	int x = 0;
	cin >> x;
	return 0;
}