【求助】关于结构体的函数传参 谢谢
int main()
{
int print (struct student);
struct student
{
int num;
char name[10];
int score;
};
struct student stu = {104, "dongdong", 90};
print (stu);
}
#include <stdio.h>
int print (struct student stu)
{
printf ("num = %d\nname = %s\nscore = %d\n", stu.num, stu.name, stu.score);
}
编译器提示print函数的形参struct "不允许使用不完整的类型" . 为什么 该怎么处理?
[解决办法]
写在里面的话,只有main看得到这个类型,对print函数来说是不可见的。