求助!顺序表逆置问题
各位大侠~~~今天做了一道关于把顺序表A中的元素逆置到顺序表B中的问题!我编的代码如下:#include<stdio.h>
#define MaxSize 100
typedef int DataType;
#include"SeqList.h"
void main(void)
{
SeqList AList;
int i,x,a[10],b[10];
printf("\n");
ListInitiate(&AList);
for(i=0;i<100;i++)
{
if(ListInsert(&AList,i,i+1)==0)
{
printf("\nWrong\n");
return;
}
}
for(i=0;i<ListLenth(AList);i++)
{
if(ListGet(AList,i,&x)==0)
{
printf("wrong!\n");
return;
}
else printf("\n");printf("List A:%d ",x);
}
int j,n;
{
for(j=1;j<=10;j++)
a[j]=x;
for(n=10;n>0;n--)
b[n]=a[j];
}
SeqList BList;
ListInitiate(&BList);
for(i=1;i<=10;i++)
for(n=1;n<=10;n++)
{
ListInsert(BList,i,b[n]);
}
for(n=1;n<=10;n++)
printf("List B:%d ",b[n]);
}
错误为:
Error newlist.cpp 40: Cannot convert 'SeqList' to 'SeqList *' in function main()
Error newlist.cpp 40: Type mismatch in parameter 'L' in call to 'ListInsert(SeqList *,int,int)' in function main()
怎么解决这个问题啊??请指点下~~~不胜感激