// Main file for Queue Abstract Data Type demo
// Marc Chee, April 2019

#include <stdio.h>
#include "queue.h"

int main(void) {
    printf("Creating the Queue of Pokemon.\n");
    queue pokeQueue = queueCreate();
    int id = 1;
    printf("Pokemon ID %d joins the parade!\n", id);
    queueAdd(pokeQueue, id);
    id = 2;
    printf("Pokemon ID %d joins the parade!\n", id);
    queueAdd(pokeQueue, id);
    id = 3;
    printf("Pokemon ID %d joins the parade!\n", id);
    queueAdd(pokeQueue, id);
    
    printf("Pokemon ID %d just walked past!\n", queueRemove(pokeQueue));
    printf("Pokemon ID %d just walked past!\n", queueRemove(pokeQueue));
    printf("Pokemon ID %d just walked past!\n", queueRemove(pokeQueue));
    return 0;
}

Resource created Thursday 18 April 2019, 12:33:29 AM, last modified Monday 22 April 2019, 04:20:43 PM.

file: main.c


Back to top

COMP1511 19T1 (Programming Fundamentals) is powered by WebCMS3
CRICOS Provider No. 00098G