Firstly this was set for coursework last week. The deadline has now passed and it is no longer being done for a grade. I would just like help getting started. I have been given the follwing header file outline :

Code:
/* file: myqueue.h -- definitions for queue manipulation routines. */

#ifndef QUEUE_DEFINED
#define QUEUE_DEFINED

typedef struct qitem {
        struct qitem *next;
        char *data;
} Qitem;
typedef struct queue {
        Qitem *front, *back;
} MyQueue;

int queue_init(MyQueue *q);                 /* return -1 on error */
int queue_empty(MyQueue *q);                /* return 1 if empty; else 0 */
int queue_put(MyQueue *q, Qitem *new_item); /* return -1 on error */
Qitem *queue_get(MyQueue *q); /* return (Qitem *)0 if the queue is empty */

#endif

/* end file: myqueue.h */
With the instruction :

Tasks

1. Create a new file myqueue.c and #include the header file shown below.
2. Implement the functions listed in myqueue.h (see below)
3. Write a main() function that uses the functions from myqueue.h, and allows the user to:
* Create new queues.
* Add an element to a specified queue.
* Remove an element and display its data.
* Display the number of elements in a queue.
* Display an entire queue, without removing elements.
4. Ensure your program is robust at dealing with errors such as attempting to remove an element where none exist.
5. Ensure that all memory which was malloc'd is free'd before your program exits

Note that the queue_*() functions should not refer at all to the data field of Qitem.

I understand it mostly but unsure how to start. Mainly where and how I initialise the "q" variable which is passed to several of the functions in the header file. Especially given that I don't know how many queues the user will want to create.

I have a switch statement coded ready to select 1 to create a queue but am unsure of where to go from here. As I say I am looking for help, not for the work to be done for me.

Any help really appreciated