1 #include <stdio.h> 2 3 #include "queue.h" 4 5 int main (void) { 6 Queue *Q; 7 8 queue_new(&Q, sizeof(int)); 9 10 size_t i; 11 int x; 12 for(i = x = 0, x = i; i < 10; ++i, x = i) 13 queue_enqueue(Q, &x); 14 15 while(queue_is_empty(Q)) { 16 queue_dequeue(Q, &x); 17 printf("%5d\n", (int)x); 18 } 19 20 queue_destroy(Q); 21 return 0; 22 }