请教一道题,关于结构体作为函数参数传递的
题目是这样的,计算日期(含年,月,日)是该年的第几天,大家帮忙帮我看看程序#include<stdio.h>
int str(struct boy a);
int main(void)
{
struct boy{
int year;
int month;
int day;}a={2004,11,30};
int w;
w=str(a);
printf("%d",w);}
int str(struct boy a)
{
int x[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int count=0,i;
count=a.day;
printf("%d\n",count);
for(i=0;i<a.month-1;i++)
count+=x[i];
printf("%d\n",count);
if(a.month>2&&((a.year%4==0)&&(a.year%100!=0)||(a.year%400==0)))
count=count+1;
printf("%d\n",count);
return (count);
}
把结构作为参数传进去,就报错了,晕,大家帮忙看看哪错了呀?