hi there i am trying to build a linked list from read a file operation. this code only adds the first node to the list. the problem is i am facing with "error: request for member 'head' in something not a structure or union" error. i call add_Node function in main like this ;
add_Node(&list, student)
and this the add_Node function.
void add_Node(LIST** list, NODE* student) {
NODE* new_stu = student;
new_stu = (NODE*) malloc(sizeof(NODE));
if( !new_stu ) {
printf("ERROR NOT ENOUGH MEMORY!!!\n");
return;
}
else {
new_stu->fn_next = NULL;
if( *(list)->head == NULL ) {
new_stu->fn_next = (list)->head;
*(list)->head = new_stu;
printf("Adding operation is succesfull\n");
*(list)->count++;
return;
}
}
}