#include #include #include #include "Student.h" Student* CreateStudent (long idNum, char* name, char *address, char* major, int birthmonth, int birthday, int birthyear) { Student* temp = (Student*) malloc (sizeof (Student)); temp->idNum = idNum; temp->name = (char*) malloc (strlen (name) + 1); strcpy (temp->name, name); temp->address = (char*) malloc (strlen (address) + 1); strcpy (temp->address, address); strcpy (temp->major, major); temp->birthdate.month = birthmonth; temp->birthdate.day = birthday; temp->birthdate.year = birthyear; return temp; } void DestroyStudent (Student* aStudent) { free (aStudent->name); free (aStudent->address); free (aStudent); } void PrintStudent (Student* aStudent) { printf ("%9ld %-20.20s %-30.30s %4.4s %02d/%02d/%d\n", aStudent->idNum, aStudent->name, aStudent->address, aStudent->major, aStudent->birthdate.month, aStudent->birthdate.day, aStudent->birthdate.year); }