可以帮我修改这个错误吗?cpp(19) : error C2660: 'insert' : function does not take 2 parameters

#include<stdio.h>structstudent{intno;charname[2];intscore;structstudent*next;}stu[2];... #include <stdio.h>
struct student
{
int no;
char name[2];
int score;
struct student * next;
}stu[2];int n;
int main()
{ struct student * head,stu[2];
void input(struct student stu[]);
struct student * insert(struct * head,struct student * stud);
void print(struct student stu[]);
printf("input the inserted record:");
int i=0;
scanf("%d, %s ,%d",&stu[i].no,&stu[i].name,&stu[i].score);
input (stu);
print (stu);
head=insert(head,&stu);
print(head);
return 0;
}
void input(struct student stu[])
{ int i;
for(i=0;i<2;i++)
{
printf("input scores of student %d:\n",i+1);
printf("name:");
scanf("%s",&stu[i].name);
printf("score:");
scanf("%d",&stu[i].score);
printf("\n");
}
}
struct student * insert(struct student * head,struct student * stud)
{
struct student * p0, * p1, * p2;
p1=head;
p0=stud;

if(head==NULL)
{
head=p0;
p0->next=NULL;
}
else
{while((p0->no>p1->no)&&(p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if(p0->no<=p1->no)
{
if(head==p1)
head=p0;
else
p2->next=p0;
p0->next=p1;
}
else
{
p1->next=p0;
p0->next=NULL;
}
}
n=n+1;
return(head);
}
void print(struct student stu[])
{ int i;
for(i=0;i<2;i++)
printf("%d %s %d\n",i+1,stu[i].name,stu[i].score);
}
展开
 我来答
山水阿锐
2015-04-09 · TA获得超过34.3万个赞
知道顶级答主
回答量:23.7万
采纳率:91%
帮助的人:3.3亿
展开全部
您好,函数doCanny(IplImage * in,double lowThresh, double highThresh,int aperture)有 4个参数,你只写了1个。

#include "highgui.h"#include "cv.h"
IplImage * gray = NULL;
IplImage *edge =NULL;
IplImage* doCanny(IplImage *in1,double lowThresh, double highThresh,int aperture )
{

//if(in->nChannels !=1)
// return(0);

gray = cvCreateImage(cvSize( in1->width,in1->height), IPL_DEPTH_8U,1 );
edge = cvCreateImage(cvSize( in1->width,in1->height), IPL_DEPTH_8U,1 );
cvCvtColor(in1, gray, CV_BGR2GRAY);

cvSmooth( gray, edge, CV_BLUR, 3, 3, 0,0 );
cvCanny( gray, edge, lowThresh, highThresh, aperture);

//cvSaveImage("6.jpg", out);//保存一个处理后的图像
//cvReleaseImage(&out);
cvDestroyWindow("haha");
return( edge );
}
int main()
{
IplImage * img = cvLoadImage("1.jpg",-1);
IplImage * out = NULL;
out = doCanny(img,1.0,3.0,3);

cvNamedWindow( "haha" ,1);
cvShowImage( "haha", out);
cvWaitKey(0);

cvReleaseImage(&img);
cvReleaseImage(&out);
return 0;
}
追问
亲,你发错地方了,害我白高兴一场
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式