不知道是链表建立出错还是其他问题,在遍历链表的时候会漏数据且崩溃

不知道是链表建立出错还是其他问题,在遍历链表的时候会漏数据且崩溃


#include
#include
typedef struct arr
{
    int nums;
    char names[40];
    struct arr* next;
}*Node;
int main()
{
    Node head, body, tail,p;
    head = (Node)malloc(sizeof(struct arr));
    tail = (Node)malloc(sizeof(struct arr));
    tail->next = NULL;
    head->next = tail;
    int n;
    printf("输入链表长度:\n");
    scanf_s("%d", &n);
    for (int i = 0; i < n; i++)
    {
        body = (Node)malloc(sizeof(struct arr));
        printf("依次输入编号,姓名;\n");
        scanf_s("%d", &body->nums);
        getchar();
        fgets(body->names, 40, stdin);
        if (i == 0)
        {
            head = body;
            tail = head;
        }
        head->next = body->next;
        head->next = body;
    }
    while (head)               //遍历链表
    {
        printf("%d   ", head->nums);
        fputs(head->names, stdout);
        head = head->next;
    }
}

head = (Node)malloc(sizeof(struct arr));
这写法不对啊。应该是sizeof(Node)啊,怎么就只考虑数组呢?