C Visual-Studio 不允许指针指向不完整的类类型

已加_CRT_SECURE_NO_WARNINGS

假期预习想自己试着写一下链表 单链双链都没问题 到循环链这里就如下(实力不济求包含)

#include<stdio.h>
#include<stdlib.h>
typedef struct{
    struct Struction* next;
    struct Struction* prep;
    int value;
}Struction;
typedef struct point{
    Struction* head;
    Struction* circle;
}Point;
void Print(Point* List,int n);
int Length(Point* List);
 void Insert(Point* List);
int main()
//循环链表 (无头结点)
{
    int n;
    scanf("%d",&n);
    Point List;
    List.head=NULL;
    List.circle=NULL;
    int i=0;
    for(i;i<n;i++){
        Struction* p=(Struction*)malloc(sizeof(Struction));
        if(List.head==NULL){
            List.head=p;
            List.circle=p;
            p->next=NULL;
            p->prep=NULL;
        }else{
            List.circle->next=p;
            p->prep=List.circle;
            List.circle=p;
            p->next=List.head;
        }
        scanf("%d",&(p->value));
    }
    Print(&List,n);
 }
 int Length(Point* List)
 {
     Struction* plist=List->head;
     int len=0;
     for(len,plist;plist!=List->circle;plist=plist->next){
         len++;
     }
    return len;
  } 
 void Insert(Point* List)
 {
     int num;
    scanf("%d",&num);
    int len=Length(List);
    if(num>=0&&num<=len){
        Struction* plist;
        Struction* p=(Struction*)malloc(sizeof(Struction));
        if(num==0){
            plist=List->head;
            plist->prep=p;
            p->next=plist;
            p->prep=NULL;
            List->head=p;
            List->circle->next=p;
        }else if(num==len){
            plist=List->circle;
            plist->next=p;
            p->prep=plist;
            p->next=List->head;
            p=List->circle;
        }else{
            plist=List->head;
            int i=1;
            if(num<=len/2){
                for(i,plist;i<=num-1;i++,plist=plist->next);
                p->next=plist->next;
                plist->next=p;
                _**p->next->prep=p;**_
                p->prep=plist;
            }else{
                for(i,plist;i<=len-num;plist=plist->prep);
                p->prep=plist->prep;
                plist->prep=p;
                _**p->prep->next=p;**_
                p->next=plist;
            }
        }
    }else{
        printf("Wrong input.\n");
    }
 }
 void Print(Point* List,int n)
 {
     Struction* plist=List->head;
     int i=0;
     for(plist,i;i<n;plist=plist->next,i++){
         printf("%d ",plist->value);
     }
     printf("\n");
 }

报错在Insert函数中的斜体粗体部分(78、84行),报错内容如标题
不清楚原因

改好了改好了,你试一下。

typedef struct node{
    struct node* next;
    struct node* prep;
    int value;
}Struction;

在57行初始化那里,加上
p->next=NULL;
p->prep=NULL;
你没给这两个初始化,报错的两行不知道指向哪,加上以后就知道指向NULL了

img

p->next->prep=p p->prep->next=p
是这两句吗?
你这不就又指回来了吗,自己指向自己了吧。。。