定义一个学生信息的结构体,包括学号、姓名和成绩三个成员,用该结构体定义两个学生的结构体数组,通过指针操作,输入和输出这两个学生信息。
#include(iostream)
using namespace std;
#include <stdio.h>
#include <string.h>
struct Student {
int stuID;
char name[10];
int achievement;
}stu1;
int main()
{
stu1.stuID=201836036;
strcpy(stu1.name,"yang");
stu1.achievement=90;
printf("%d %s %d",stu1.stuID,stu1.name,stu1.achievement);
return 0;
}