结构体,声明调用出了问题,帮忙看一看
#include<stdio.h>#define N 30
#include<stdlib.h>
struct student
{
char xm[N];
char xh[N];
double ps[N];
double qz[N];
double qm[N];
};
void main()
{
student *p;
double s[N];
void creat();
creat(p);
void cout();
cout(p);
for(int i=0;i<N;i++)
printf("%f",s[i]);
}
void cout(student *q)
{
int x,y,z,i;
double s[N];
printf("请输入百分比:");
scanf("%f",&x);
scanf("%f",&y);
scanf("%f",&z);
for(i=0;i<N;i++)
{
s[i]=q->ps[i]*x+q->qz[i]*y+q->qm[i]*z;
}
}
void creat(student *q)
{
int i;
for(i=0;i<N;i++)
{scanf("%f",q->xm[i]);
scanf("%f",q->xh[i]);
scanf("%f",q->ps[i]);
scanf("%f",q->qz[i]);
scanf("%f",q->qm[i]);
}
}
问题:C:\Program Files\Microsoft Visual Studio\MyProjects\222\0.cpp(17) : error C2660: 'creat' : function does not take 1 parameters
C:\Program Files\Microsoft Visual Studio\MyProjects\222\0.cpp(19) : error C2660: 'cout' : function does not take 1 parameters