どういう仕組みで動いているのか詳しく教えてくれるとありがたいです。
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct list{
char name[20];
int age;
struct list *next;
};
int main(void){
struct list *head;
struct list *dummy, *new, *prev, *current;
dummy = (struct list *)malloc(sizeof(struct list));
strcpy(dummy->name, "");
dummy->age=0;
dummy->next=NULL;
head=dummy;
while((new = (struct list *)malloc(sizeof(struct list)) )){
printf("氏名と年齢をスペースで区切って入力してください\n");
if(scanf("%s%d", new->name, &new->age)==EOF) break;
current = head;
prev = head;
while( current!=NULL){
prev = current;
current = current->next;
}
new->next = current;
prev->next = new;
}
}