0
Awais's Avatar, Join Date: Dec 2009
Newbie Member
I want queue implementation using linked list with Classes
By the way Nice work
0
tehdoughnut's Avatar, Join Date: Mar 2012
Newbie Member
This code has an error. If the list empties all of the way then rear doesn't point to null when it should. The delete function should be:

Code:
void qdelete(node **front,node **rear)
{
    node *delnode;      /* Node to be deleted */
    if((*front)==NULL && (*rear)==NULL)
        printf("\nQueue is empty to delete any element\n");
    else
    {
        delnode=*front;
        (*front)=(*front)->next;
        if((*front) == NULL)
            (*rear) = NULL;
        free(delnode);
    }
}