关于结构体数组作函数参数的问题
有一段程序:程序代码:
#include <stdio.h> struct Students { int num; int score; }; void print_under_sixty(struct Stduent *stds,int t) { int i,count; printf("================\n"); printf("name score\n"); for(i=1;i<=t;i++) { if(stds.score[i] < 60) { count++; printf("%d%10d\n",stds[i].num,stds[i].score); } } printf("the count of under sixty : %d\n",count); } void main() { int total = 0,i; Students std[30]; for(i=1;i<30;i++) { printf("student %d ",i); std[i].num = i; scanf("%d",&std[i].score); if(std[i].score < 0) break; total++; } printf("num score\n"); for(i=1;i<=total;i++) { printf("%d%10d\n",std[i].num,std[i].score); } print_under_sixty(std,total); }
print_under_sixty里面好多错误,求大神分析