I\'m trying to implement a generic linked list. The struct for the node is as follows -
typedef struct node{ void *data; node *next; };
Typecast temp->data to int and then print.
cout<<*((int *)temp->data);