请问为什么编译时会出现这种错误,怎么解决
#include<stdio.h>#include<stdlib.h>
struct clerk
{
char name[20]; /* 姓名 */
long jbgz; /* 基本工资 */
long zwgz; /* 职务工资 */
long gwjt; /* 岗位津贴 */
long ylbx; /* 医疗保险 */
long gjj; /* 公积金 */
};
int Menu();
int choice;
int inputdata(struct clerk clerks[]);
int outputdata(struct clerk clerks[]);
int main(void){
int choice;
struct clerk clerks[100];
int n,m;
choice=Menu();
while(choice!=0){
switch(choice){
case 1:
n=inputdata(clerks);
break;
case 2:
m=outputdata(clerks);
break;
}
choice=Menu();
}
return 0;
}
int Menu(){ /*主菜单*/
int mychoice;
printf("欢迎使用职工信息管理系统\n");
printf("1.输入记录\n");
printf("2.显示记录\n");
printf("3.修改记录\n");
printf("4.查找记录\n");
printf("5.删除记录\n");
printf("6. 统计\n");
printf("请输入选择:");
scanf("%d",&mychoice);
return mychoice;
}
/*输入职工的基本信息*/
int inputdata(struct clerk clerks[])
{
int i,n;
printf("Input n:");
scanf("%d",&n); /*输入职工的人数*/
for(i=0;i<n;i++) {
printf("姓名:");
scanf("%s",clerks[i].name);
printf("基本工资:");
scanf("%d",&clerks[i].jbgz);
printf("职务工资:");
scanf("%d",&clerks[i].zwgz);
printf("岗位津贴:");
scanf("%d",&clerks[i].gwjt);
printf("医疗保险:");
scanf("%d",&clerks[i].ylbx);
printf("公积金:");
scanf("%d",&clerks[i].gjj);
}
return n;
}
/*显示记录*/
int outputdata(struct clerk clerks[],int n){
int i;
printf("姓名\t 基本工资\t 职务工资\t 岗位津贴\t 医疗保险\t 公积金\n");
for (i = 0; i < n; i++ )
printf("%s\t %d\t %d\t %d\t %d\t %d\n", clerks[i].name, clerks[i].jbgz, clerks[i].zwgz,clerks[i].gwjt,clerks[i].ylbx,clerks[i].gjj);
}
C:\Users\dell\AppData\Local\Temp\ccqelkmg.o zgxxgl.cpp:(.text+0x56): undefined reference to `outputdata(clerk*)'
C:\Users\dell\Documents\collect2.exe [Error] ld returned 1 exit status