typedef struct student
{
…
…
…
};struct student st[N];
void subject (student st[],int n)
函数调用时出现错误:unkown type name "student"
未知student类型名称
怎么改
typedef struct Student
{
...
}student;
student st[N];
这么用哈
第一个分号前加上student
typedef struct student
{
…
…
…
}student;
student st[N];
void subject (student st[],int n);
或者
#include<stdio.h>
#define N 10
struct student{
}student;
struct student st[N];
void subject (struct student st[],int n);
int main()
{
printf("Hello world!");
return 0;
}
void subject (struct student st[],int n)
类型要写全
或者在struct定义后面给struct取个别名