linked list noob - function create new list
Well i have list with names and year of birth. Now I want to pass that list into function and year (for example 1982) so function should return newly formed list containing only names with specified year. This function must create new list inside function. So this is problem for me. How to create new "start" head inside function? how to fill it with data and display them?I tried but no luck. Note, it must be single linked list.
Code:
struct student
{
char name[20];
int year;
struct student *next;
};
struct student *head = NULL;
struct student *selection(struct student *head,int year )
{
}