Posted By: carlpa
Linked lists as containers - 12/08/10 16:55
To all the wonderful, kind, and understanding programers out there,
Thank you in advance for your help. I am trying to create a linked list set of "methods" which can be in a "linked_list.c" file and included in many different programs. My idea is create a list of elements. Each element has a void pointer (void* ptr;) as a member. This pointer should be able to point to anything, structure, variable, STRING*, etc, which is why it is declared void in the element definition.
What is the best way to assign this pointer to the required item?
Thank you in advance for your help. I am trying to create a linked list set of "methods" which can be in a "linked_list.c" file and included in many different programs. My idea is create a list of elements. Each element has a void pointer (void* ptr;) as a member. This pointer should be able to point to anything, structure, variable, STRING*, etc, which is why it is declared void in the element definition.
What is the best way to assign this pointer to the required item?