The following code is to store integer in a link list. How can i modify it so that it is able to store objects in a link list ? For your information, i am not asking solution directly for my assignment. I am asking where i can seek help so that i know how to start with it only.
Code:
struct node{
int data;
struct node *next;
}*list,*prev,*temp,*tmpdisp,*newnode;
newnode = (struct node*) malloc(sizeof(struct node));
newnode ->data = element;
newnode ->next = NULL;
if (list == NULL)
list = newnode;
else
{
list->next = newnode;
list = list->next;
}