F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^#include typedef struct lnode{int data;struct lnode *next;}linklist;linklist creat(int n){linklist *head,*p1,*p2;int i;int a;head=NULL;printf("输入数据");for(i=
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/02 17:53:55
![F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^#include typedef struct lnode{int data;struct lnode *next;}linklist;linklist creat(int n){linklist *head,*p1,*p2;int i;int a;head=NULL;printf(](/uploads/image/z/14022256-40-6.jpg?t=F%3A%5CACM%5Cqt%5CxunhuanSL%5Cmain.c%3A34%3Aerror%3Atoo+few+arguments+to+function+%27creat%27+p%3Dcreat%28%29%3B+%5E%23include+typedef+struct+lnode%7Bint+data%3Bstruct+lnode+%2Anext%3B%7Dlinklist%3Blinklist+creat%28int+n%29%7Blinklist+%2Ahead%2C%2Ap1%2C%2Ap2%3Bint+i%3Bint+a%3Bhead%3DNULL%3Bprintf%28%22%E8%BE%93%E5%85%A5%E6%95%B0%E6%8D%AE%22%29%3Bfor%28i%3D)
F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^#include typedef struct lnode{int data;struct lnode *next;}linklist;linklist creat(int n){linklist *head,*p1,*p2;int i;int a;head=NULL;printf("输入数据");for(i=
F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^
#include
typedef struct lnode{
int data;
struct lnode *next;
}linklist;
linklist creat(int n){
linklist *head,*p1,*p2;
int i;
int a;
head=NULL;
printf("输入数据");
for(i=0;idata=a;
if(p1=NULL)
head=p1;
else
p2=p1->next;
p1=p2;
}
p1->next=head;
return *head;
}
int main(void)
{
int n;
printf("输入节点数\n");
scanf("%d",&n);
linklist *head,*p;
p=creat();
head=p;
while(p!=head){
printf("%d",p->data);
p=p->next;
}
printf("\n");
return 0;
}
F:\ACM\qt\xunhuanSL\main.c:34:error:too few arguments to function 'creat' p=creat(); ^#include typedef struct lnode{int data;struct lnode *next;}linklist;linklist creat(int n){linklist *head,*p1,*p2;int i;int a;head=NULL;printf("输入数据");for(i=
34行 p=creat(); 改成p=creat(n);