[prev] [index] [next]

Exercise: Implementing Quack Functions

Implement the following functions for the Linked List implementation of quacks:

int   isEmptyQuack(Quack);   // return 1 if Quack is empty, else 0
void  makeEmptyQuack(Quack); // remove all the elements on Quack
void  showQuack(Quack);      // print contents of Quack, from the top down

Notes:

  • all functions should check whether incoming quack qs has been initialised
  • if qs->next == NULL the quack has been initialisd but is empty