mercredi 1 juillet 2015

Generic Linked List in C with run time data types [on hold]

I want to create a linked list which can accept any data type at run time and display the list. The problem is display function and memory management changes for different data types. So I don't know how to do that. Code examples will be appreciated. Edit: to narrow down the problem. this is queue structure(using linked list)

 struct node            
{
    void *data; 
    struct node *link; 
};

struct queue
{
    struct node *front; 
    struct node *rear;  
};          

Aucun commentaire:

Enregistrer un commentaire