#include<stdio.h>
#include<stdlib.h>
#define OK 2
typedef int Status;
typedef int ElemType;
typedef struct{
ElemType *elem;
int length;
}SqList;
Status ListInsert(SqList *L,int e){
ElemType *q=(L->elem);
ElemType *p=L->elem+L->length-1;
for(p;p>=q;p--){
if(*p>e){
*(p+1)=*p;
*p=e;
}
else
break;
}
L->length++;
return OK;
}
int main(){
SqList L;
L.elem=(ElemType *)malloc(100*sizeof(ElemType));
int a[]={1,3,5,7};
L.elem=a;
L.length=4;
ListInsert(&L,4);
for(int i=0;i<L.length;i++) printf("%d ",*(L.elem+i));
return 0;
}
请问为什么结果打印不出来