4.7.3 List Implementation of the Queue with Records in Dynamic Memory

The third queue implementation is also a list梠ne involving dynamic storage allocation of the records in dynamic memory. First, the following declaration must be made:

typedef struct record

{

whatever info;

struct record *link;

}queuerecord,*queue;

Setqueue must set queue to null. Insert will first request storage for the new record to be inserted by invoking malloc. It will then set its info data and insert it as the new last record in the queue. Remove must delete the first record of the queue and return its info data.

Your deck has now been "stacked," you've been "queued" into queues, and you mustn't postpone your obligation to use them!