yo había hecho algo hace unos meses pero sin tener bien los conceptos de pilas  y colas, hoy por hoy ya he usado pilas y colas en c++. Esto es un .h de un 
proyecto que tenía no se si te sirve realmente, está en c
también en la librería standard hay soporte para pilas y colas, 
queuestack////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// UTN FRGP TSP 
// BS
// EMAIL: david_bs@live.com
// 09-09-2011
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _PILA_H_
#define _PILA_H_
//
char pila[256];
//
const char* P_Pila()
{
	return pila;
}
void P_Constructor(int cantidad_de_elementos)
{
	memset(pila, 'X', sizeof(char)*(cantidad_de_elementos));
	memset(&pila[cantidad_de_elementos], 0, sizeof(char));
}
void P_Destructor()
{
}
void P_Inicializar(const char* buffer)
{
	int len=strlen(buffer);
	char backup[256];
	int index;
	for(index=0;index<len;index++)
		backup[index]=buffer[index];
	backup[len]=0;
	strcpy(pila, backup);
}
void P_Push(int len, char elemento)
{
	int index;
	for(index=0; index<len;index++){
		if(pila[index]=='X'){
			pila[index]=elemento;
			break;
		}
	}
}
void P_Pop(int len)
{
	int index;
	for(index=(len-1); index>=0;index--){
		if(pila[index]!='X'){
			V_Push(len,pila[index]);
			pila[index]='X';
			break;
		}
	}
}
void P_Quitar(int pos_elemento)
{
	pila[pos_elemento]='X';
}
int P_Tope(int len)
{
	int index;
	for(index=0; index<len;index++){
		if(pila[index]=='X'){
			return index;
		}
	}
	return len-1;
}
int P_Elementos(int len)	
{
	int elementos=0;
	int index;
	for(index=0; index<len;index++){
		if(pila[index]!='X'){
			elementos++;
		}
	}
	return elementos;
}
/*void P_Mostrar(int len)
{
	int c=0;
	int index;
	//int len=strlen(pila);
	for(index=0;index<len;index++){
		if(pila[index] != 'X'){
			printf("%c", pila[index]);
			c++;
		}
	}
	if(c==0) printf("vacia\n");
	printf("\n");
}*/
//
#endif