那位大侠帮忙指出问题,在vc++6.0中运行,始终说有一个错误。谢谢。

[复制链接]
查看11 | 回复3 | 2011-4-8 03:22:34 | 显示全部楼层 |阅读模式
#include
#include
typedef struct
{int data[100];
int last;
}SeqList;
voidSeqLCreat(SeqList *L)
{
int i,n;
printf("\t请输入表的长度:");
scanf("%d",&n);
L->last=n-1;
printf("\t依次输入表中的数据元素(整数):\n");
for(i=0;idata);
return ;}
}
void SeqLPrint(SeqList *L)
{
int j;
if(L->lastlast;j++);
printf("%5d",L->data[j]);
printf("\n");
return ;}
void main()
{
SeqList *L;
printf("建立顺序表");
L=SeqLCreat();
printf("输出顺序表");
L=SeqLPrint();
printf("成功完成");}
}

回复

使用道具 举报

千问 | 2011-4-8 03:22:34 | 显示全部楼层
楼主要明白程序里所有的引用都必须存在,即已经编译保存才能引用。所以下一个turbo c++3.0,在里面找到这个函数库,把它放在include文件夹里面就可以用了。
回复

使用道具 举报

千问 | 2011-4-8 03:22:34 | 显示全部楼层
#include#includetypedef struct { int data[100]; int last;}SeqList;SeqList * SeqLCreat(){ SeqList *L=new SeqList; int i,n; printf("请输入表的长度
回复

使用道具 举报

千问 | 2011-4-8 03:22:34 | 显示全部楼层
调用写错了! void 你还L= printf("建立顺序表");SeqLCreat(*L);printf("输出顺序表");SeqLPrint(*L);自己弄吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行