Personal I have to do a dequefile function. Get the user: -1 to dequeue an element or 2 to queue an element That is the user to queue has to enter option 2 and then enter the values and go adding so. If he wants to remove a value from the queue, the user will type -1 and will withdraw, removing until empty.
I've made the queuing, I want to know how you do the dewandling.
#define TAM_FILA 10
typedef struct
{
int inicio, fim;
int fila[TAM_FILA];
} tipo_fila;
int desenfileirar(tipo_fila *fila)
{
//printf("\n\n Desenfileirar ...\n");
if(fila->inicio==fila->fim)
{
printf ("Fila vazia!");
}
else
{
/*int i;
for(i=0; i < TAM_FILA; i++)
{
fila->fila[i]=fila->fila[i+1];
}
fila->fila[fila->fim]=0
fila->fim--;*/
}
return 0;
}