C++中编程出现function does not take 1 parameters
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/25 19:12:51
C++中编程出现function does not take 1 parameters
#include "stdio.h"
#include "stdlib.h"
#define NULL 0
struct node
{
int num;
struct node *next;
};
void main()
{
struct node *creat();
void print();
struct node *head;
head=NULL;
head=creat(head);
print(head);
}
struct node *creat(struct node *head)
{
struct node *p1,*p2;
p1=p2=(struct node *)malloc(sizeof(struct node));
scanf("%d",p1->num);
p1->next=NULL;
while(p1->num!=0)
{
if(head==NULL) p1=head;
else
p2->next=p1;
p2=p1;
p1=(struct node *)malloc(sizeof(struct node));
scanf("%d",&p1->num);
}
p2->next=NULL;
return head;
}
void print(struct node *head)
{
struct node *temp;
temp=head;
while(temp!=NULL)
{
printf("%6d",temp->num);
temp=temp->next;
}
}
出现的问题是:
error C2660:'creat' :function does not take 1 parameters
error C2660:'print' :function does not take 1 parameters
#include "stdio.h"
#include "stdlib.h"
#define NULL 0
struct node
{
int num;
struct node *next;
};
void main()
{
struct node *creat();
void print();
struct node *head;
head=NULL;
head=creat(head);
print(head);
}
struct node *creat(struct node *head)
{
struct node *p1,*p2;
p1=p2=(struct node *)malloc(sizeof(struct node));
scanf("%d",p1->num);
p1->next=NULL;
while(p1->num!=0)
{
if(head==NULL) p1=head;
else
p2->next=p1;
p2=p1;
p1=(struct node *)malloc(sizeof(struct node));
scanf("%d",&p1->num);
}
p2->next=NULL;
return head;
}
void print(struct node *head)
{
struct node *temp;
temp=head;
while(temp!=NULL)
{
printf("%6d",temp->num);
temp=temp->next;
}
}
出现的问题是:
error C2660:'creat' :function does not take 1 parameters
error C2660:'print' :function does not take 1 parameters
struct node *creat();
void print();
函数声明和定义不一致,参数类型和个数是要一致的,改成这么声明
struct node *creat(struct node *head);
void print(struct node *head);
void print();
函数声明和定义不一致,参数类型和个数是要一致的,改成这么声明
struct node *creat(struct node *head);
void print(struct node *head);
C++中编程出现function does not take 1 parameters
function does not take 1 parameters
function does not take 3 parameters 这个错误怎么修改
c语言编程 :error C2064:term does not evaluate to a function
cf出现wrong parameters!
vc++ error C2064:term does not evaluate to a function
python中出现IndentationError:unindent does not match any outer
Why not ____ a taxi to go home?A.taking B.take C.does take D
matlab 出现Function definitions are not permitted at the promp
英语翻译candidate weighting parameters of the mean function corr
she does not take her cousin_____(shop )
cf安装好了,出现一个Wrong parameters!