C language Generic programming
I want to design generic container for example linked list.
I tried using void* as an element but failing to provide following.

    list.insert(5);
    list.insert("Hello");

If I allocate the member on heap and passing address works, but how to handle the case of for stack variable or same in the example above.

Thanks
Avinash

C language Generic programming
===

I want to design generic container for example linked list.
I tried using void* as an element but failing to provide following.

    list.insert(5);
    list.insert("Hello");

If I allocate the member on heap and passing address works, but how to handle the case of for stack variable or same in the example above.

Thanks
Avinash
