sc/queue/queue_example.c
Ozan Tezcan c221478638
Switched to tabs for indentation, amalgamation tool works with tabs only (#66)
* Switched to tabs for indentation, amalgamation tool works with tabs only
2021-04-07 00:28:50 +03:00

31 lines
506 B
C

#include "sc_queue.h"
#include <stdio.h>
int main()
{
int *queue;
int elem;
sc_queue_create(queue, 0);
sc_queue_add_last(queue, 2);
sc_queue_add_last(queue, 3);
sc_queue_add_last(queue, 4);
sc_queue_add_first(queue, 1);
sc_queue_foreach (queue, elem) {
printf("elem = [%d] \n", elem);
}
elem = sc_queue_del_last(queue);
printf("Last element was : [%d] \n", elem);
elem = sc_queue_del_first(queue);
printf("First element was : [%d] \n", elem);
sc_queue_destroy(queue);
return 0;
}