C语言结构体作为函数参数问题
一个学生信息管理系统;单独做一个函数引用结构体,请问在C 语言中结构体如何被函数引用?
写了一点点,但是有错:
#include<stdio.h>
void total(struct)
{
struct student;
int i;
for(i=0;i<3;i++)
student[0].total+=student[0].b[i];
}
void main()
{
struct a
{
int b[3];
int total;
int avg;
};
struct a student[1] ={
{ 23,45,65 }
};
total(student);
printf("total is %d\n",student[0].total);
return(0);
}