// 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 6 years ago, last modified 6 years ago.

file: main.c


Loading...


Back to top

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