这个链表实现哪里有误

终端没有任何输出也没有输出完成显示

#include <stdbool.h>
struct Node;
typedef struct Node *List;
typedef struct Node *Position;


bool IsEmpty(List L);
bool IsLast(Position P);
char GetKey(Position P);
int GetValue(Position P);
void SetKey(Position P,char);
void SetValue(Position P,int);
void Advance(Position P1,Position P2);
Position Find(char key,List L);
void Delete(char name,List L);
Position FindPrevious(char name,List L);
void Insert(char name,int value,List L,Position P);  //将新节点\
                                             插入p之后
void show(List L);
        
    


struct Node
{
    char key;
    int value;
    Position next;

};

#include "Linklist.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>

bool IsEmpty(List L){
    return L->next == NULL;
}
bool IsLast(Position P){
    return P->next == NULL;
}
void Advance(Position P1,Position P2){
    P1->next=P2;
       
}
char GetKey(Position P){
    return P->key;
}
int GetValue(Position P){
    return P->value;
}
void SetKey(Position P,char name){
    P->key=name;
}
void SetValue(Position P,int value){
    P->value=value;
}
Position Find(char key,List L){
    Position P;
    P=L->next;
    while (P != NULL && P->key!=key)    
    {
        if (!IsLast(P))
            P=P->next;
    }
    if (IsLast(P))    //为什么要加括号?
        return NULL;
    else
        return P;
    
}
void Delete(char name,List L){
    Position P,temp;
    P=FindPrevious(name,L);
    if (P != NULL)
    {
        temp=P->next;
        P->next=temp->next;
        free(temp);
    }
    else
    {
        printf("Node doesn't exist!\n");
    }

}
Position FindPrevious(char name,List L){
    Position P;
    P=L;
    while (P->next != NULL && P->next->key!=name)
    {
        P=P->next;
    }
    if (IsLast(P))    //为什么要加括号?
        return NULL;
    else
        return P;


}
void Insert(char name,int value,List L,Position P){
    Position new;
    new=malloc(sizeof(struct Node));
    if (new==NULL)
        printf("Out of space!!!");   //不知道error咋用。。
    new->key=name;
    new->next=P->next;
    P->next=new;
}
void show(List L){
    Position P;
    printf("%-5s%-5s","key","value");
    if (IsEmpty(L))
        printf("please set some nodes.\n");
    else
        P=L->next;
        while (!IsLast(P))
        {
            printf("%-5s%-5d\n",P->key,P->value);
            P=P->next;
        }
}


int main()
{


    struct Node *p0,*p1,*p2;
    SetKey(p0,'a');
    SetKey(p1,'b');
    SetKey(p2,'c');
    SetValue(p0,15);
    SetValue(p1,29);
    SetValue(p0,37);
    

    Advance(p0,p1);
    Advance(p1,p2);
    Advance(p2,NULL);
    show(p0);
    return 0;
}

修改如下,供参考:

#include <stdbool.h>
struct Node;
typedef struct Node* PtrToNode;
typedef PtrToNode List;
typedef PtrToNode Position;

bool IsEmpty(List L);
bool IsLast(Position P);
char GetKey(Position P);
int  GetValue(Position P);
void SetKey(Position P, char);
void SetValue(Position P, int);
void Advance(Position P1, Position P2);
Position Find(char key, List L);
void Delete(char name, List L);
Position FindPrevious(char name, List L);
void Insert(char name, int value, List L, Position P);  //将新节点 ,插入p之后
void show(List L);


struct Node
{
    char key;
    int  value;
    Position next;
};
#include "Linklist.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
bool IsEmpty(List L) {
    return L->next == NULL;
}
bool IsLast(Position P) {
    return P->next == NULL;
}
void Advance(Position P1, Position P2) {
    P1->next = P2;
}
char GetKey(Position P) {
    return P->key;
}
int GetValue(Position P) {
    return P->value;
}
void SetKey(Position P, char name) {
    P->key = name;
}
void SetValue(Position P, int value) {
    P->value = value;
}
Position Find(char key, List L) {
    Position P;
    P = L->next;
    while (P != NULL && P->key != key)
    {
        if (!IsLast(P))
            P = P->next;
    }
    if (IsLast(P))    //为什么要加括号? IsLast()是函数
        return NULL;
    else
        return P;
}
void Delete(char name, List L) {
    Position P, temp;
    P = FindPrevious(name, L);
    if (P != NULL)
    {
        temp = P->next;
        P->next = temp->next;
        free(temp);
    }
    else
    {
        printf("Node doesn't exist!\n");
    }
}
Position FindPrevious(char name, List L) {
    Position P;
    P = L;
    while (P->next != NULL && P->next->key != name)
    {
        P = P->next;
    }
    if (IsLast(P))    //为什么要加括号?IsLast()是函数
        return NULL;
    else
        return P;

}
void Insert(char name, int value, List L, Position P) {
    Position new_m;  //new 是关键字,改为 new_m
    new_m = (Position)malloc(sizeof(struct Node));
    if (new_m == NULL)
        printf("Out of space!!!");   //不知道error咋用。。申请空间不成功时,提示信息。
    new_m->key = name;
    new_m->next = P->next;
    P->next = new_m;
}
void show(List L) {
    Position P;
    printf("%-5s%-5s\n", "key", "value");
    //printf("%-5s%-5s", "key", "value");
    if (IsEmpty(L))
        printf("please set some nodes.\n");
    else
        P = L;//P = L->next;
    while (P){  //!IsLast(P)
        printf("%-5c%-5d\n", P->key, P->value);
        //printf("%-5s%-5d\n", P->key, P->value);
        P = P->next;
    }
}

int main()
{

    struct Node* p0 = nullptr, * p1 = nullptr, * p2 = nullptr;
    p0 = (Position)malloc(sizeof(struct Node));
    p1 = (Position)malloc(sizeof(struct Node));
    p2 = (Position)malloc(sizeof(struct Node));
    SetKey(p0, 'a');
    SetKey(p1, 'b');
    SetKey(p2, 'c');
    SetValue(p0, 15);
    SetValue(p1, 29);
    SetValue(p2, 37);

    Advance(p0, p1);
    Advance(p1, p2);
    Advance(p2, NULL);
    show(p0);
    return 0;
}

img

p0 p1 p2指针好像没有申请空间?

首先,你这些
struct Node *p0,*p1,*p2;
都没有初始化啊

printf("%-5s%-5s","key","value"); 后面两个变量的冒号去掉
if (IsLast(P)) //为什么要加括号? 括号是函数调用符,根据函数名意思是 判断p是否是最后节点