Contents

Description

The function destroys the queue and frees the memory allocated for it.

Warning
this function should be always called when you stop using the queue, otherwise you can get memory leaks.

Function signature

int destroy(int size);

Params

The function has only one parameter: the pointer to the queue, that is to be destroyed.

Return value

The function returns 0 if the queue was successfully destroyed, and -1 if the queue was not initialized.