C++问题执行出现error LNK2001: unresolved external symbol "int __cdecl creatlist(struct node *)"
来源:百度知道 编辑:UC知道 时间:2024/05/12 15:45:55
#include<iostream.h>
struct node
{double data;
node *next;
};
node *h=NULL,*p=NULL,*s=NULL;int i;
int creatlist(node *);
int showlist(node *);
void main()
{int a;
cout<<"1.creat the list"<<endl<<"2.show th list"<<endl;
cin>>a;
switch(a)
{case 1:creatlist(h);break;
case 2:showlist(h);break;
}
}
int creatlist(node * &head)
{i=2;
p=new node;
if(p==NULL) {cout<<"failure";return 0;}
head=p;
cout<<"data1=";
cin>>p->data;
while(p->data!=0)
{s=new node;
p->next=s;
p=s;
cout<<"data"<<i<<"=";
cin>>p->data;
i++;}
p->next=NULL;
return 0;
}
int showlist(node *head)
{p=h;i=1;
while(p->next!=NULL)
{cout<<"data"<<i<&
struct node
{double data;
node *next;
};
node *h=NULL,*p=NULL,*s=NULL;int i;
int creatlist(node *);
int showlist(node *);
void main()
{int a;
cout<<"1.creat the list"<<endl<<"2.show th list"<<endl;
cin>>a;
switch(a)
{case 1:creatlist(h);break;
case 2:showlist(h);break;
}
}
int creatlist(node * &head)
{i=2;
p=new node;
if(p==NULL) {cout<<"failure";return 0;}
head=p;
cout<<"data1=";
cin>>p->data;
while(p->data!=0)
{s=new node;
p->next=s;
p=s;
cout<<"data"<<i<<"=";
cin>>p->data;
i++;}
p->next=NULL;
return 0;
}
int showlist(node *head)
{p=h;i=1;
while(p->next!=NULL)
{cout<<"data"<<i<&
int creatlist(node * &head)
这里出错了
链接错误.可能是相关的头文件没有包含进来,也可能是相关的函数没定义.或者是定义了,但是有错误,链接程序找不到.
^_^
C++问题执行出现error LNK2001: unresolved external symbol "int __cdecl creatlist(struct node *)"
c语言程序执行时出现以下情况,是什么问题?
兄弟215c全清是出现machine error
c源文件编译执行问题
CAD2005 出现问题 执行错误
c语言问题:error C2059: syntax error : ']'
c语言问题 Floating point error: Overflow.
MP3出现FILE SYSTEM ERROR是什么问题
电脑无法开机 出现keyboard error 问题
用百度杀毒时,无法使用安博士,出现myv3 2004(error:0)无法执行文件