|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include <stdio.h>
#include <string.h>
struct student
{
int num;
char name[20];
float score[3];
};
void print(struct student);
void main()
{
struct student stu;
stu.num = 001;
strcpy(stu.name, "Fishc.com!");
stu.score[0] = 95.5;
stu.score[1] = 98.8;
stu.score[2] = 93.2;
print( stu );
}
void print(struct student stu) //此处的函数为什么和之前声明的函数不一样呢,这里的stu之前为什么不用写呢???//
{
printf("\tNumber : %d\n", stu.num);
printf("\tName : %s\n", stu.name);
printf("\tScore[0] : %5.2f\n", stu.score[0]);
printf("\tScore[1] : %5.2f\n", stu.score[1]);
printf("\tScore[2] : %5.2f\n\n", stu.score[2]);
} |
|