hetrogenous linked list
I have found from an ebook that we can maintain links between hetrogenous elements by void pointer.But then how we will be able to derefrence it since, derefrencing void pointer is illegal and also we do not know the type of node at prior to runtime.
Did the book said you can?
There are a few ways to build heterogeneous containers. It involves a few tricks obviously. As you realized, it can't be done in a simple way.
However, if you are trying to hold elements in a linked list pointing to a base hierarchy, you can effectively hold any of the derived types without the need to resort to pointers to void.