怀念万人坑,北京读研中:(twitter @qkshan
#include <stdio.h>#define CLASS_SIZE 3typedef unsigned long ulong;typedef struct tagStudentT { char name[20]; ulong number; //max size=4294967295; float score; }StudentT;void AddStu(StudentT *p){ int i; for(i=0;i<CLASS_SIZE;i++) { printf("please enter a new student' name number score:\n"); scanf("%s %ld %f",p.name,&(p.number),&(p.score)); }}void PrintStu(StudentT *p){ int i; int Length=CLASS_SIZE; printf("Name Number Score \n"); for(i=0;i<Length;i++) { printf("%-25s%-25lu %5.1f\n", p.name, p.number, p.score); } //getch();}int main(int argc,char *argv[]){ StudentT classmates[CLASS_SIZE]; AddStu (classmates); /* add a studen's info to the classes! */ PrintStu(classmates); /*print the student's info to the screen*/ return 0;}